Photoemission study of clean and oxygen-covered aluminum and magnesium