Fixes

Lots of fiddly bits.