cleanup & small fixes on hashing