Fix wrong generating afs ast-tree