Should fix most of the magic energy related bugs