Fix and update tests. First functional test.