Improved protocol error handling