fix some problems with merge