Minor bug fix in stitching.