Fixed rare stack overflow from dense forest generation.