Fix compile warning and findbugs defect.