Fixes some bugs in network