Bad branch merge removal