Increase code coverage in existing modules

Not all the existing modules have a 100% code coverage. This is mostly due to callback functions that aren't executed while running the unit tests.
I haven't tested this, might need some tweaking.