Fixed confusing duplicate variables