Fixed an infinite loop timeout issue.