Add a check for zero, and never do a swap if the later element is zero.