Fixed some post-merge bugs