Use realpath to ensure path consistency across platforms