Merge pull request #8861 from annando/fix-empty-network