fixed an endless loop when length of chars is a divisor of 256
Merge branch 'morhekil-master'