Bug fixing for contamination removal and quality filtering