Fix signed/unsigned comparison causing compile error