Fix merge bugs