fixed a few ast evaluation bugs/code cleanups, copied from asteval