Add some upper limits to dubious loops.