Fixed/tested addtohist(cmd) and savehist().  Both work perfectly.