Fix for slices going off the end of the contig