Advinc rebase2

@lamblin Ugh, this seems really messy to keep trying rebases and making new branches.
I managed to rebase on the right master this time, I think. However, I'm still getting errors, which I don't know where they come from. I looked through the total diff, and I don't see where things went wrong. I'll try to track it down. Let me know if you see anything obvious.