Gets fail in case of small caches

Thanks for the bug report @tarmo-randma (and welcome btw). This is a very interesting potential bug.

ping @ibrahim

ps: 40 bytes is a VERY small cache