fixed some minor defects detected by Coverity