Fixed potential stack overflow.