fix various findbugs errors categorized CORRECTNESS and BAD_PRACTICE

**please review**
they're both inner classes, just for different things.