Improve real path fix for mac from last commit