made workaround for StubModel not getting instantiated. also a few other fixes