fix signed/unsigned comparison warnings