Added some early protocol definitions and various changes