When an imprisonment has been imposed for a violation of this division, and before the termination of the sentence, the defendant is released by the vacation of the sentence of imprisonment and the imposition of a fine or forfeiture instead, the fine or forfeiture shall be recorded and accounted for in the same manner as though it had been imposed in the first instance.