Imporve handling of invalid packets

Added decoder for broken TCP packets.
Moved pretty printer local in each file where it is used, as it is not working otherwise,