Fix return type for decodePacket