Fix edge case where a directory has a space in its name