Bug fixes in clean_alignments.py