Fix functional tests to work in shell