Update magma (July 8 2013)

Includes some fixes and clean-up

Signed-off-by: Alec Ari <neotheuser@ymail.com>