Various bugfixes related to network issues