add tests, fix typos