fix integer comparisons
Merge pull request #380 from racker/fixes/integer_cast

fix integer comparisons