Magnetic Field Morphology Effects on the Determination of Oxygen and Iron Abundances in the Solar Photosphere