Makes unbuildable fences only connect to themselves
Merge pull request #6659 from reaperrr/linebuild-fix

Fixes #6635