I've fixed all of the above, and rebased on current master. I'll merge
it tonight unless something else pops up.