Fix bug in variable naming (same name used twice)