Deserialization code.