added device discovery tests
fixed handling of subdevices