Document DecodeNext/EncodeNext, and fix a bug found by go vet