fixed ast bugs