Fixes class type compatibility checking when assigning.
Fixes #50