More JS corrections on device.php