Fix bug writing TNG output from dump.