Does it have a TRE installed?
If so, the TRE will mask the resistance values from the GPS (gear position sensor), and the ECM always provides the fueling for a given gear - usually 5th or 6th gear.
However, if there is no TRE installed, the GPS must work. Sometimes (often in my case :banghead) the contacts in the switch (sensor) itself become fouled and it doesn't report the proper value to the ECM. Thus, it causes a different fuel map to be used than would be otherwise. Usually manifested in lower RPM ranges via odd throttle response. Again, a TRE will cover up a GPS problem of this sort, and thats a good thing.
The GPS resistances and voltages can be verified with a meter. Mine would change as the engine warmed up.
This is not likely the solution to your high rpm problem, but might be worth looking at just so you know where it stands.