Hi horde111,
I came across the same problem as you.
IR codes change because of using pin 11 for analog write. Use pin 11 as digital out and use pin 9 or 10 as PWM analogwrite. Then IR codes do not change. I think as pin11 is a MOSI pin codes change though i do not know why. It has been a long time since the last post. I know u would have moved on. But this may be of some help to others making the same mistake as us.