The only way to fix this is to retrain your muscle memory. If it is important enough to take the time, the only way to reconfigure muscle memory is through repetition.
For example, I tend to spell the word "the" as "teh" because of the same script you're asking about. To reinstall the memory, I simply repeated the word again and again, starting slowly, striving for 100% accuracy and increasing speed. This is the same technique that I use to get better at Guitar Hero.
source share