Fix bug in reporting protocol errors