Fix some warnings found by coverity scan.