Fix stack overflow introduced in 012ac05aa9de47ae421af4c0e7d0724de2d18d82