Add test to demonstrate issue #412
Merge branch 'master' into issue_412
Fix test and fix the way we deal with UUID removal

Previously we were removing the object's UUID directly in the for loop, but this was causing the modification of the original list and was causing errors. Now, if we found objects that need to be removed, we do this later.