Fix addClass, toggleClass and hasClass with empty or no argument. Closes #831.