Bug 24993: Make sure we are not going to loop indefinitely