Rebase fixes.

I've totally mangled the history with these rebases; sorry, future programmer!