fixed some functionnal tests logic