Fixed group_by_target_url_dir

Was grouping by file, not by directory.

Reported by Tim Cuthbertson.