Added networking, improved error messages and various minor changes.