Fix the file length field

Looks like there's a typo where the `format` variable used by the for-loop is referenced instead of the `formats` array.