It should return NIL when no entry is found in the cache, not NULL.
Attached patch fixes that.
Thanks,Amit