Made sure that .removeClass(null) doesn't throw an exception. Fixes #3847.