Added mod_spell_cast and various mod_functions fixes.