Fixed a bug when the console execute /spec on or /spec off (ClassCastException)