fixed merge errors and compiler errors