Richard, there can be many reasons why the learned codes have erratic behavior. Consider these tips for getting a clean learned ir signal:[Link: remotecentral.com]
What edmund and Daniel were trying to explain, is that you can avoid this learning process altogether. How the FLIRC device works is that it emulates a USB keyboard. When it gets an IR signal it recognizes, it basically "types" the corresponding key into the device that it is plugged into. You teach it what key it sends when it sees a specific IR signal.
So for your MX-850, you can create a FireTV device and assign any IR codeset (one that doesn't match other devices in your system) to this FireTV device. Both edmund and Daniel have made suggestions for a good device. On my mx-780 and mx-990 remotes, I assign the Aux 001 from the URC database as the codeset for FireTV.
Once you have an IR code set assigned to the FireTV device in your remote, then you use the Flirc application to program each of the IR keys to the appropriate keyboard command for FireTV. I use the media keys for transport control but I also uses an extended list of keyboard commands for other functions within applications like Kodi (subtitle, audio track, audio delay, etc.).
The advantage of this method is that the codes in the library are usually very clean, repeat properly, etc., and completely avoids the IR learning step. Hope that helps.