python3 fixes in magpis & fermilat

Continued work on python 3 fixes