Misc fixes

A slew of minor changes and fixes.