Fixes bug with multiple merges