Fix the file length field

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