Fixed bugs during spell switching