Fixed minor merge bugs