Correct building of syntax tree