Fix theoretical issue with packet UID's, small cleanup/changes