Replace variable only with defined variable
If the index is negative, the variable is ignored
Reset project on "new project" action.
Update the title bar according to the project name.