Replaced get_class() calls with instanceof operators

This PR replaces get_class() calls with instanceof operators.

Fixes #570.
I think these will have to stay as get_class(). `__CLASS__` will yield the `Base` class.