Functional tests bug fixed