FindBugs errors and warnings fixed