Fixes bestFit to cope with gaps