Fix crash on bad paths