The president narrowly avoided another primary endorsement blunder after he initially only backed Wilson’s opponent.