Fix broken threshold comparison

They must be interpreted as integers in order for the comparisons
to work.
Merge pull request #3 from boivie/cast-int

Fix broken threshold comparison