Fix TraceCheckParser's treelike parsing bug and add unit test for TraceCheck parser