Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.