Ps/cosmetic

These changes are mostly cosmetic and are based on information reported by the IDEA code analysis report. All basic stuff. Code base got clean compile, all junit tests ran, and UI functionality remains the same.