C++ fix: isEmpty calculation was mixing unsigned and signed integers