fix various findbugs errors categorized CORRECTNESS and BAD_PRACTICE

**please review**
Don't modify this file please.