<img src="smileys/smiley2.gif" border="0" align="middle" /> It's your debug code! In "New Location" you are calling this for DebugText2:
Location.UID & " " & Location.LocationState & " " & Function.Call("MapGen") & newline
There are no parameters on this call to MapGen.