Code cleanup: more fixes based on findbugs findings

Fixes based on findbugs reports.
Update junit version, and add junit test for Utils class.