Fixed bugs in inserting gaps after pairwise alignment