Fix memoization setup