(a) If, through mistake or otherwise, any person is sentenced for a definite period of time for any offense, the sentence shall not be void, but the person shall be deemed to be sentenced nevertheless as provided by the terms of §§ 40-20-107 — 40-20-110, and shall be entitled to all the benefits and subject to the liabilities under §§ 40-20-107 — 40-20-110 in the same manner and to the same extent as if sentence had been pronounced in the terms and manner required thereby.
(b) This section shall have no application in the case of persons convicted of second degree murder, rape of a female over the age of twelve (12) years, carnal knowledge and abuse of a female under the age of twelve (12) years, assault and battery upon a female under the age of twelve (12) years with the intent to unlawfully carnally know her, robbery by the use of a deadly weapon, or kidnapping for ransom. Persons convicted of the offenses of this subsection (b) shall be given a determinate, and not an indeterminate sentence.