fixed unit tests and added support for modules