Fixed grid generation loop to support LESS 1.4.1