Bug in memoize reset method fixed

[bugfix]

This bug essentially made the reset operation do nothing, which caused
stale mappings to appear in the memoize database, which caused weird
type errors that spontaneously disappeared after a server restart.