Hashmap unit tests and fixes