Fixing recursion resource expiration problem

### References

Reported at https://savannah.gnu.org/bugs/?37581