Fix NULL decoding. Fixes #8.

This is the simplest version I can think of. Suggestions are welcome.