Fixed bug with incorrect merge