Increase test coverage

The goal is to have the current feature set well covered by unit tests.