Fix bug with group merge.