The legislative effort was necessary because the Pennsylvania election agency bungled a referendum.