Fix bug that found when run testing addClass and removeClass.