Fixed process path in cases of substr returning false.