Cleanup, misc fixes