Fixed minor issues pointed out by Coverity scan