Implement more robust way to ensure a correct filepath across OS.