fixes #674: Copying objects with local variables

 * fixed the double variable issue
 * fixed some reference issues regarding the ```ChangeVariableBrick```
   and ```SetVariableBrick```

**Jenkins testrun:**
not available yet.