Properly handle paths containing spaces