Minor formatting changes.
Changed handling of determining target folder.