Fix inplace merge