Improve error handling when unwrapping received data.

Submitted by:	Rick Macklem