Fixed handling of the boundary that lines on the halo.