Fixes some protocol errors