fix small bug in merging.