Removing non-valid alignments