decode: more debugging stmts
decode: fix detection of EOF