Fixed null object dereference in DSElementSelection.BuildOutputAst