Corrected a bug with the execution of device scripts