Fixing wraparound.
This still needs a tremendous amount of cleanup.