Fixed everything so that Functional test works