Fixed multiple reuses of same variable name.