fixed minor bugs in packet parser