Scope of variable, fix CSV format if no targets