Use better code for packet cache ordering

Reverse-compares labels as they should be compared, thanks to @nlyan for the idea, and help.