Resolved conflicts and fixed some bugs