PATCH: fix unsigned compare

I fixed the unsigned compare problem, but doesn't push to my git repo. Here is the patch.

Sorry.