Proper magic and other fixes