Moved merge to be closer to the composition functions.