Fixes and changes to Helper.castSpell.