This needs an ```array_replace_recursive```, otherwise ```linked``` is overwritten every time.