Address some code review comments in memoize.