fix bugs in memorize_kwargs_toargs

I found that when memoize work on a method with some default args, it's failed. I fixed that.