Fix an erroneous variable name

Close #3356
Close #3367
Merge branch 'develop', remote branch 'upstream/develop' into develop