fix bug with add_version_to_leaf

 - calculate dups by filename instead of md5
 - fix reference to filename that was pointing to package name