Fixed small issues with merge utility and finished writing unit tests for merge