Import ClassRegistry before using.

Fixes #3594