Fixed bug in reduction to two paths