Now memoizes functions that may return nil properly