Fix several remaining memoization issues