Fixed merge bugs