bugfix: an unsigned comparison should be signed