Well, what you are describing make no sense. However, there is a major issue in the files that you've provided. PugBuildMapsMenu() has a major flaw in it that prevents it from properly populating the menu pointer. The "Menu" parameter needs to be "by ref" instead of "by value" for it to work properly.
I have no idea if this is related to your issue but the map menu shouldn't work at all for sure.
Therefore, this needs fixed before you continue trying to figure out your issue just in case it is causing the issue.