Guesses at fixing typos in Dmitri's code.