Fix for issue #91 and #92 (signed / unsigned comparison)