Fix handling invalid models when PUTting

Issue #21