Support enum decoding. fixes #3