More issues reported by Coverity

Please review.