Fixed bug for loop paths