Check that DURATION value is not null before calling toString on it.
Add test to verify that writeOutputData does not throw exceptions when data such as DURATION is missing.
Merge branch 'issue-2-avoid-npe-when-writing-output-data'