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.
Haven't thought about that. Will remove shortly. Thank you!