Fix an erroneous variable name

Close #3356
Close #3367