Fixed minor issue causing json files to be produced incorrectly.