Improve deep_merge hash value class comparison