Fix several dozens of errors/warnings reported by FindBugs

Some of the issues are real bugs, others are just considered a bad practice.
The changes should not affect the behavior in any way, "mvn clean install" works fine, I also did not found any issues when running the GWT dev mode and clicking through UI.