Made the check for deserialization errors more explicit.