Fix device validation