(1) Where, before the commencement of this Act, a person has undergone a period of imprisonment in a prison in the State by way of execution, or purported execution, of a sentence of imprisonment imposed under a law as in force in the Territory, whether or not the person is in such a prison at the commencement of this Act, he shall be deemed to have duly served that period of imprisonment in accordance with that sentence or law.
(2) Where, before the commencement of this Act, a person has been removed in custody from the Territory to the State, and detained in custody in the State, for the purpose of giving effect to an order or sentence of a magistrate or court, that removal and detention, and any act or thing done in relation to that removal or detention, shall be deemed, for all purposes (including the purposes of any action or proceeding, whether instituted before or after the commencement of this Act), to have been as lawful as they would have been if this Act had been in force at the time of the removal and detention and the removal and detention had been in accordance with this Act.