Fix path recalculation, was popping the first path entry every time