improved functional tests