Fixes classes wrongly being assigned as static classes.

Closes #348.