Added additional debugging statements and patched packetRealLength