Made default name functionality more robust to the existane of modules.