Fixed runtime errrors and fixed a bug that caused the system not to removed, canceled classes