Fixed more issues found by findbugs

Fixed more issues found by findbugs