Add decoding errors

Closes #4.