Invert `class_exists()` check to look for new class instead of old.

Fixes #688.

looking for the old class causes problems when it didn't exist. @drak Please test before finally merging.