Fix the defualt args behavior.
Merge pull request #5298 from lucacopa/SR_fix_to_script

Fix the default args behavior.