Fixed some errors with the merging