The Role of Defects in Functional Oxide Nanostructures