Improve main test coverage

Fixes #273