Improved path handling.