Correct hashing, add debug output