Defect chemistry and electrical properties of BiFeO3