Improved deep_copy