Do not store -1 as the Model's id if an error occurs. Fixes #4.