Fixed some erros in the receiver of packets