Clean up error handling in the deserializer