fix a few merge bugs