Fix Findbugs and compiler warnings