Some porting work on get_alignments.