Small fixes

Small fixes:
- the example code in the README did not work.
- set a default codec when decoding when none is specified in the header.