A picture would help in describing the problem.
But here's a guess. You're hatching to the inside walls of the structure while also masking the pipes to the outside of the structure, there by, creating a gap from the end of the masked pipe to the inside wall of the stucture.
BTW: The pipe hatching is going to follow what ever the current layer is ....