Fixed a problem with dependencies in the ModuleLoader (see #6599)