Fixed mis-use of variable names