I might be mistaken, but is there a bug in the Show instance of PortNum?
Not a bug, an annoying misdesign (IMO). A PortNum is actually in network byte order. If you extract it, you get the original port; if you simply show it, you see it byteswapped on little-endian platforms.