fixed some signed/unsigned comparisons