Corrected packet parsing algo

Signed-off-by: Christina Quast <chrysh.ng+github@gmail.com>