Some misc cleanup and removal of unused imports.