make deserialize() more robust against undefined functions