Extracting just the good bits of the Boundary bug fix.