Correct deserialization of an object