Fixed bugs in network and messages