Fix findbgs errors

Fixed errors reported by Findbugs.