cleanup dead code
fix typo Error in device.cpp