Merge pull request #1544 from pavolas/master

Infinite loop on network thread