Autocorrect bad file layouts. Closes #68