Fix bug in device module, tests passing
Fix backslash+newline warning in device_query