Fix crash for init repository