Replaced the hash_only_merge method again with upstream version