Add debugging printfs
Fix packet size checking to be more tolerant