Made unbuildable fences only connect to themselves

Fixes #6635.