Where any said company shall have sold to citizens of the United States, or to persons who have declared their intention to become such citizens, as a part of its grant, lands not conveyed to or for the use of such company, said lands being the numbered sections prescribed in the grant, and being coterminous with the constructed parts of said road, and where the lands so sold are for any reason excepted from the operation of the grant to said company, it shall be lawful for the bona fide purchaser thereof from said company to make payment to the United States for said lands at the ordinary Government price for like lands, and thereupon patents shall issue therefor to the said bona fide purchaser, his heirs or assigns: Provided, That all lands shall be excepted from the provisions of this section which at the date of such sales were in the bona fide occupation of adverse claimants under the preemption or homestead laws of the United States, and whose claims and occupation have not since been voluntarily abandoned, as to which excepted lands the said preemption and homestead claimants shall be permitted to perfect their proofs and entries and receive patents therefor: Provided further, That this section shall not apply to lands settled upon subsequent to the 1st day of December, 1882, by persons claiming to enter the same under the settlement laws of the United States, as to which lands the parties claiming the same as aforesaid shall be entitled to prove up and enter as in other like cases.