added more tests. some fixes