Better checking of device path