Added improper input handling for casting spells.