Fix protocol parsing