Fix loop condition in GetModuleName()