Fixed assignment of the module instances

All modules are assigned by reference now.