Improve test coverage; add tests