Fix modules dispatching. Addd test for handling unknown module error