Fix decoder error handling; improve decoder example