Fix case sensitivity for special class names.

The current behaviour is incorrect as special class names are case-insensitive as demonstrated here:
http://3v4l.org/4g7Hj