Fixed some issues with merging.