Fixes #9320. Added a workaround for MSVC bug that causes invalid reference being saved in add_value_manip.