An interesting section of Blood Meridian (1985) by Cormac McCarthy has the gang of "Indian fighters" surrounded and out of powder, so one of them manages to make it from scratch, making charcoal from wood, saltpeter from bat guano and finding sulfur in a volcanic area, but the final step has them urinating on the mixture and then drying it in the sun. I understand that urine can in fact be a source of nitrates but given that they already had saltpeter, I am puzzled. At the same time, I understand that gunpowder is made wet to form larger grains but this can be done with water (I think), which they had access to.
The gunpowder was first dry so urinating on it was not for safety; it may have been an old-fashioned idea about how to make gunpowder and an unnecessary step or at least water would work as well for "corning" – making granules from it.