Small fixes to magic module.