Fixed a stack overflow.

Fixed a stack overflow.