Fixed a couple of bugs with the Magma interfacing.