Fix a stack overflow error