[FLAPI-166] tweaks to infinite loop detection