Fixed a fundamental bug with stream reader and writer

added two more packet types
debugging