Fixed change device bug.
Fine-tuned apply functionality.