Lenght is unsigned
Fixed signed/unsigned comparison warnings