Bugfix to sampleclean logic.