Electronic Structure of Oxygen-Deficient SrTiO3 and Sr2TiO4