fixed various warnings, removed unused imports, etc