Check to avoid possible infinite loop.