Fixing signed vs. unsigned comparison

Thanks to Martin Maurer for spotting this

Related to issue #154