Fix the bug in the functional tests