Fix memoize decorator: raise instead of storing None