http://memory-alpha.org/en/wiki/Dagger_of_the_Mind_(episode)
You can also alter or clear bad thoughts with a neural neutralizer ( http://memory-alpha.org/en/wiki/Neural_neutralizer ) found exclusively on the Tantalus Penal Colony....then GM can be "good" again...no more thoughts of Corvairs, Citations, Olds diesels, Chevettes, Vegas, and any other bad design from GM.