Fix protocol handling