Length variables in for loops must not be overwritten