Fix error referencing class that may not have been evaluated

Closes GH-121