Handling of hooks and surrogates in generated deserialization.