Invert test for errcode before copying scan terms (duh!)