Fix bug in re-assign by reference