Improve handling of platform-specific paths