Fixed wrong behaviour on receiving packets multiple times.