Properly handle spaces and $ in path