Fix minor error in generate_sha1 string handling