Fix regression in saving device object.