Fixed issue with packet encoding.