Fixed hash algorithm. I don't know what I was thinking when I wrote the last one.