(a) Irregular and Similar Pleas.—If an accused after arraignment makes an irregular pleading, or after a plea of guilty sets up matter inconsistent with the plea, or if it appears that he has entered the plea of guilty improvidently or through lack of understanding of its meaning and effect, or if he fails or refuses to plead, a plea of not guilty shall be entered in the record, and the court shall proceed as though he had pleaded not guilty.

(b) Pleas of Guilty.—A plea of guilty by the accused may not be received to any charge or specification alleging an offense for which the death penalty is mandatory. With respect to any other charge or specification to which a plea of guilty has been made by the accused and accepted by the military judge, a finding of guilty of the charge or specification may be entered immediately without vote. This finding shall constitute the finding of the court unless the plea of guilty is withdrawn prior to announcement of the sentence, in which event the proceedings shall continue as though the accused had pleaded not guilty.

(c) Harmless Error.—A variance from the requirements of this article is harmless error if the variance does not materially prejudice the substantial rights of the accused.