Bugfix add and modify devices.