Bug fix in clean-sequence