Fix bug in decode.