Fixing compiler warning signed/unsigned comparison