Handle paths with spaces correctly