Improve hash.c comments, error-checking.