Remove unused imports and fix random compile errors