Fixed Magma issues

Closes #331