Correctly iterating over devices in stopAll