"I noticed that HS mode changes back to XT when I compile."
Of course because XT is the default value if there's no DEFINE OSC_HS included. But what about if you set HS mode when programming ???

which programmer do you use??