Fixing a bug in cloning infected devices. Adding a unit test to track it