Fixed a stack overflow error.