Fix issue tests and assert stubs

This pull request introduces two changes. 
1. It fixes the tests for issues
2. It asserts that the stubs that where used in the tests are actually called. Without those introduced assertion there are corner cases in which the tests are green, even if the assertions in the stub where not called.