fix compiler warning about unsigned comparison