This is an engineering choice: do you merge first and then fix the remaining issues or do you get everything perfectly clean first and then merge?
I've seen large rewrites and migrations take both approaches -- in my experience, the former usually works out better.