Coverity fixes

Just a couple of minor fixes coverity flagged up.
Parentheses around comparisons.