Fixed some networking bugs