Modified castSpell method in an attempt to avoid breaking.