Made changes to problem areas reported by findbugs.