Wrong fields printed to files