Removing unreachable modules from definition.