Fixed bug with path extraction