bugfixes, mainly due to trying out PMD and findbugs