another important thing to test for
fix dead 2:nd refresh bug

- need deepcopy when creating an alias
- removed a few unnecessary scoped variables from scoped sub