Removed unused imports, fixed some warnings

Removed all unused imports.
Fixed some warnings.