Fixed some network bugs and added network test apps