Fix inlined fetching of custom model instances