fix Device.query(key > value) and Device.query(key < value)