Bugfix for model instantiation