more tests, bug fix