Improved the error reporting for deserialization.