Misc fixes and cleanup

Foo