fix trailing comma in output, fixes #31