Fix regression in device detection scripts.