fixing some PMD and FindBugs