Fixed some bugs and conflicts