Use os.path.basename instead of splitting on '/' to be windows-safe.