Merge plugin working (almost) correctly. A few bugs around to fix