Fix issues when initializing repo in an existing project folder