Improve deserialization code.