fixed source directory issues

os.path.basename does not work with trailing /