Fixed unsigned integer underflow issue.