Fixed regression for dynamic parent

Fixes #1578 
instead of renaming variables, you could return ``$parent``. It would probably be easier to read