Studies on magnesium- and titanium-substituted LaCoO3