Cleanup instrument_ast function.