Fixed compiler warnings, mainly involving unused imports and deprecated methods