Improve coverage

* Some tests fixed and some new added.
* Optional parameters that can actually never be omitted became mandatory.
* Exceptions that check consistency inside modules replaced with asserts.
Remove assertion from the code
Merge pull request #86 from eush77/coverage

Improve coverage