Added better packet loopback detection