Improve checking the combinations of flags in the functional test