fix signed/unsigned comparison