Fix bugs upon merge