Fix bugs with lesser-used hashes

Add test cases