Fixed a bunch of warnings

mostly unused imports and variables.