Merge pull request #147 from lydell/bugfixes

Bugfixes
Small bugfix for recent change for #88
Merge branch 'develop' into huffman