Tweak to avoid infinite loop in testing code