many small improvements to ast evaluation code