AST test; various fixes