Add tests, fix typos