corrected a copy/paste error in the if and the incrementation of nbif that was forgotten