SQL Engine : fix flatten function tests, some fixes en traverse