Fixes MetaModels/core#494.

Thanks to @Hauge for providing a test environment.