Can you wrap this in a `typeof` check for object? This is copying simple properties over to the clone unnecessarily.