Made error more informative, returned resulting path.