Also from the TOS Star Trek season 2, episode 24, “The Ultimate Computer”
The wrong ‘engrams’ imprinted at the root of the AI kernel is nothing but trouble in the M5 model. Installed aboard the USS Enterprise, Kirk had to convince the M-5 unit to shut itself down so it could be removed from its systems.