Improved path normalization