Fix ugly bug in packet insertion.