add tests, fix setLevel