Fix bug writing TNG output from dump.

The output was incorrectly located in an if statement.
Partial fix of #1510

Change-Id: I85823d9369f208f21f4bafe19705e9e4dd2da027