fix a bug in device.c.
3 files changed