Fix to confusing and potentially unpredictable conditionals.
This is a fix similar to the djb2_hash fix.