Fixed bug in path selection.