Some changes to make the stack overflow error less common