Fix wrong return value for device type check