fixing some PMD and FindBugs errors