Tweaked add-device and added add-user functions