Fix .dep metadata files

Since the basename fix, was overwriting the .dep file for each dep,
so that only the last dep was present.