Fixexistsontypedhash

patch developed in co-production with jnthn and moritz to fix issues with "exists" on typed hashes