Fix for dereferencing past end of mGuiModes.