FindBugs fixes

Checked sources with FindBugs and fixed some issues.