Improved entity deserialization.