Fixed tiny bugs found by findbugs