various fixes

Here's some pre-1.3.0 fixes.

Thanks for all the hard work!