Fixes to editing and deleting devices and adding sensors.