Change unknown device's naming rule

Use an unknown device’s last segment of its ip address as its name.
Also fixed a bug in test_others.py.