Merge pull request #21 from szabadka/master

Fix undefined behavior in decoder.