KeyError was being suppressed somewhere.

prim KeyError was being printed but execution continued. The unstable
state naturally caused other errors but the root problem was annoying to
spot.