His name was David Johansson, not Gustafsson. Johansson is the name shown in all sources.
However, on his birth record his father's name was Gustaf. Probably a mistake by the priest because his father's name was Johan Gustaf.
Another mistake by the priest was made on David's wife. Her name was Greta Karolina Johansdotter, but after 1863 her name was changed to Gustafsdotter and remained that until her death.