Avoid stack overflow in tests