Quadratic Zeeman Corrections For Metastable Levels of Mg and Ca