Fixes exception handling for creating model instances