fix some coercive comparisons and missing semicolons

Spotted this on pullreview, plus it triggered my semicolon-adding addiction.