Fix incorrect variables used
Merge pull request #1538 from Ruby184/fix/incorrect-variables-used

Fix incorrect variables used