Fix for dictionary encoding and decoding

There appears to be a bug with dictionary encoding and decoding ... correct?