fixed bugs in Device execution file.