Debug printing in device.py