Fixed a bug in loadModule where new modules were not being created