Fix --device option bug