. . "If the court finds in favor of the applicant, it shall enter an appropriate order with respect to the conviction or sentence in the former proceedings, and any supplementary orders as to rearraignment, retrial, custody, bail, discharge, correction of sentence, or other matters that may be necessary and proper." . . .