Fix up ugly record unhashing

- prevents conditions where records might be iterated over twice