R4: Fix infinite loop