More fixes similar to the djb2_hash fix.

I made the initial change to what I thought the intent was, but the intent here is also not as it originally appeared, as variables were being both set and checked against within the conditional statements. The conditionals should now reflect their original intent while (hopefully) being clearer and warning free.