Fix tests, close #7, close #8