Fixed some network bugs