Address various warnings in source files.

First batch of resolved warnings in various Java source files.
Warnings not removed include deprecation issues and typecasting warnings.