MAINT: add an explicit check on zero iteration