Fix isModuleEmpty, resolves #551