The provisions of section 612 apply, with such modifications as may be necessary to a defendant who is confined in any correctional facility.