Fixed infinite looping in packet parser