Remove unneeded packages. Fix warning on variable access.