Improved the path parsing.