Backporting the HashStorage from master.