Fixing ProtocolThread and imports