Fix issue with signed/unsigned comparison