Hi Marc,
See the following lines in the dipole fitting process that ignores bad channels:
Cheers, Martin