Limit reads/writes to 24 bits

This is because of overflow in bit shifting.
Fix: reading over the array length
Fix: Don't skip if Hash of the first word is 0

Since the values vector is initialized with 0, the first word
was skipped if its hash was 0. The purpose of this check should
be only to avoid duplicate words insertion.
Typo