Further improved path handling.