Fix some signed/unsigned compiler warnings in for loops