
950 P.2d 620 (1997)
The PEOPLE of the State of Colorado, Plaintiff-Appellee,
v.
Samuel W. COOPER, Defendant-Appellant.
No. 95CA1765.
Colorado Court of Appeals, Div. IV.
June 12, 1997.
Rehearing Denied July 24, 1997.
Certiorari Granted February 2, 1998.
*621 Gale A. Norton, Attorney General, Stephen K. ErkenBrack, Chief Deputy Attorney General, Timothy M. Tymkovich, Solicitor General, Lynne M. Oliva, Special Assistant Attorney General, Denver, for Plaintiff-Appellee.
David F. Vela, Colorado State Public Defender, Karen N. Taylor, Deputy State Public Defender, Denver, for Defendant-Appellant.
Opinion by Judge KAPELKE.
Defendant, Samuel W. Cooper, appeals a judgment of conviction entered on jury verdicts finding him guilty of second degree burglary and assault on the elderly. We affirm.
The convictions arose from events that took place on March 1, 1995, when defendant broke into his mother's home in violation of a restraining order and assaulted her.
At trial, defendant testified that his mother had invited him to her home and that he had not physically assaulted her. The prosecution requested leave to cross-examine defendant concerning a prior incident on February 26, 1995, which had led to the issuance of the restraining order. The court granted the motion, finding that evidence as to the prior incident was "very clearly res gestae."
Thereafter, defendant acknowledged on cross-examination that his mother had called the police and had him arrested on February 26, 1995. The prosecutor also examined defendant about two of the conditions of his release on bond following that arrest: that he have no contact with his mother and that he not return to her home.
*622 In the course of cross-examination, defendant testified that he had assumed he could return to his mother's house if she invited him over. The prosecutor asked, "Come on, Mr. Cooper, you know the system, don't you?" The defense voiced an objection, which the trial court overruled. The prosecutor reiterated, "You know how this works, don't you?" Defendant answered, "No, I don't."
The prosecutor also asked about defendant's conviction five years earlier for trespassing: "That was for breaking into a girlfriend's house; is that correct?" The defense objected, and the court allowed the question but indicated that the prosecution could not go into further detail as to the prior conviction.
The jury was instructed that, in order to find defendant guilty of burglary, it had to find that he knowingly, unlawfully entered a dwelling with the intent to commit the crime of assault. The court also instructed the jury: "Regarding the crime of second degree burglary, the intent to commit a crime ... can be formed either before entry into the dwelling or after an entry into the dwelling."
The convictions here at issue followed.

I.
Defendant contends that the reversal of the burglary conviction is required because the court improperly instructed the jury that a person need only be shown to have formed the intent to commit a crime "either before entry into the dwelling or after an entry into the dwelling." We disagree.
Section 18-4-203(1), C.R.S. (1986 Repl.Vol. 8B) provides: "A person commits second degree burglary if he knowingly breaks an entrance into, or enters, or remains unlawfully in a building or occupied structure with intent to commit therein a crime against a person or property."
A conflict of authority exists as to whether a person must have the intent to commit a crime at the time of entry in order to be guilty of burglary under this statute. People v. Angell, 917 P.2d 312 (Colo.App. 1995) and People v. Trujillo, 749 P.2d 441 (Colo.App.1987) indicate that the criminal intent may be formed after entry, but People v. Barnhart, 638 P.2d 814 (Colo.App.1981) held that a conviction for burglary requires evidence that defendant entered the building with intent to commit crime.
The reasoning of Trujillo and Angell is based on the language of § 18-4-203(1), which provides that burglary may be committed by one who knowingly "remains unlawfully" in a building with intent to commit a crime therein. The "remains unlawfully" language was added to the burglary statute when it was repealed and reenacted in 1971. See Colo. Sess. Laws 1971, ch. 121 at 427.
The division in Barnhart followed the supreme court's decision in Hutton v. People, 177 Colo. 448, 494 P.2d 822 (1972). In Hutton, the court reversed the conviction of a defendant who stole a wallet from an office building. The court noted there was no evidence that the defendant had entered the office with the intent to steal the wallet. However, Hutton was decided under a previous version of the burglary statute that lacked the "unlawfully remains" language.
Nevertheless, Hutton was decided shortly after the burglary statute was repealed and reenacted to include the "unlawfully remains" language, and the opinion contains the following dictum:
The burglary statute has been amended in various respects since [1966]. The trial court was of the opinion that the amendments had changed the rule.... We must disagree. The element of intent involved here has remained unchanged....
Hutton v. People, supra, 177 Colo. at 450, 494 P.2d at 823. This language may be read to suggest that the intent element remained unchanged despite the addition of the "unlawfully remains" language in the 1971 reenactment. However, the court may have been referring instead to other amendments to the statute which were enacted in 1967. See Colo. Sess. Laws 1967, ch. 289 at 529.
In light of this ambiguity or uncertainty in the supreme court's dictum in Hutton, and based on the later rulings of divisions of this court in Trujillo and Angell which considered the effect of the statutory amendments, *623 we decline to follow Barnhart and, instead, conclude that a conviction under § 18-4-203(1) may be affirmed if the intent to commit a crime is formed while a person remains unlawfully on the premises. The trial court thus did not err in instructing the jury that defendant could have formed the intent to commit assault after entering his mother's home.
Defendant also claims the instruction is improper because it indicates that he could be guilty of second degree burglary if he had the intent to assault his mother only before entering her house.
An incorrect jury instruction may be considered harmless if its erroneous aspect does not relate to any contested issue at trial. See People v. Esquibel, 794 P.2d 1065 (Colo. App.1990).
Here, neither party submitted any evidence that defendant had the intent to commit assault only before he entered his mother's house. All the evidence at trial related to his conduct during and after his entry of the building. Hence, this aspect of the jury instruction, even if erroneous, did not concern any contested issue at trial. Any error in this regard was, therefore, harmless.

II.
Defendant next contends that the trial court erred in allowing the prosecution to cross-examine him regarding the February 26, 1995, arrest and the resulting restraining order. Defendant asserts that, by making its res gestae ruling after he had chosen to testify, the court allowed the prosecution to "ambush" defendant with the details of the prior arrest. We disagree.
Evidence of other offenses or acts that form part of the criminal episode or transaction with which defendant is charged is admissible to provide the fact-finder with a full understanding of the events surrounding the crime. People v. Quintana, 882 P.2d 1366 (Colo.1994). Such res gestae evidence can include prior episodes which provide necessary background for the charged offense. People v. Allen, 944 P.2d 541 (Colo.App.1996)
Before admitting evidence as res gestae, the trial court must find that its probative value is not substantially outweighed by the danger of unfair prejudice. People v. Rollins, 892 P.2d 866 (Colo.1995).
In Allen, a division of this court determined that the events leading up to the issuance of a prior restraining order were relevant as res gestae evidence surrounding the defendant's later entry into the victim's home and threats against the victim. This evidence was important to explain the victim's state of mind, which was relevant to the charges against defendant. People v. Allen, supra.
The facts here are analogous. Defendant had been living with his mother before his February 26, 1995, arrest. Evidence of the restraining order was relevant to show two elements of second degree burglary: that entry was unlawful and that defendant knew so.
The concept of "opening the door" allows courts to prevent one party from gaining an unfair advantage by the selective presentation of facts that, unless placed in context, may create a misleading impression. People v. Miller, 890 P.2d 84 (Colo.1995).
Here, when defendant testified that his mother had invited him to the house, he necessarily opened the issue as to the lawfulness of the entry. The prosecution was entitled to present this additional evidence to rebut defendant's version of events. Specifically, the cross-examination called into question whether defendant's mother would plausibly have invited him to her house three days after she had asked police to remove him and after entry of a restraining order prohibiting his return.
We therefore conclude that defendant's testimony on direct examination opened the door for the prosecution to introduce additional res gestae evidence concerning defendant's prior arrest and restraining order. Hence, the trial court did not err in admitting this evidence.

III.
Defendant next contends that the trial court committed reversible error in allowing *624 the prosecution to question him about the circumstances of his trespass conviction five years earlier and about his alleged familiarity with "the system." We disagree.

A.
All prior felony convictions and their nature may be shown to impeach the testimony of a defendant who elects to testify on his own behalf. Candelaria v. People, 177 Colo. 136, 493 P.2d 355 (1972). A description of the nature of a prior conviction is not limited to its statutory title, but may also include a brief recital of the circumstances. People v. Hardy, 677 P.2d 429 (Colo.App. 1983).
The scope of cross-examination regarding the details of prior offenses is committed to the trial court's discretion. However, any details elicited must be relevant to the offense currently charged. People v. McGhee, 677 P.2d 419 (Colo.App.1983).
Here, the prosecution did no more than establish the nature of defendant's prior conviction. Upon defense objection, the trial court precluded further questioning on the subject. We thus find no abuse of discretion.

B.
Evidence of a defendant's other crimes or bad acts that are extrinsic to the events charged is inadmissible unless the trial court determines, outside the presence of the jury, that such evidence satisfies the requirements of CRE 404(b). Presentation of such evidence must also be accompanied by a limiting instruction to the jury. People v. Spoto, 795 P.2d 1314 (Colo.1990).
Here, it is conceivable that the prosecutor's questions regarding defendant's familiarity with "the system" might have suggested that defendant had been subject to other restraining orders in the past or been involved in other criminal proceedings.
However, the jury could well have understood these somewhat general questions as simply challenging the credibility of defendant's claims that he did not understand the restraining order after receiving verbal and written instructions from the magistrate upon his release after the February 26, 1995, arrest. We therefore conclude that the questions did not actually seek the admission of prior bad act evidence under CRE 404(b).
Also, given the overwhelming evidence that defendant entered his mother's house in violation of the restraining order and assaulted her, there is little possibility that the prosecutor's questions about defendant's knowledge of "the system" had any impact on the jury's verdict. See People v. Blehm, 791 P.2d 1177 (Colo.App.1989), aff'd, 817 P.2d 988 (Colo.1991). We therefore conclude that any error by the court in allowing these questions was harmless.

IV.
Defendant's final contention is that the cumulative effect of the errors committed by the trial court denied him a fair trial. We disagree.
Numerous formal irregularities, each of which in itself might be deemed harmless, may in the aggregate show the absence of a fair trial and thus require reversal. People v. Roy, 723 P.2d 1345 (Colo. 1986). Any errors here, however, whether considered separately or in the aggregate, did not affect the fundamental fairness of the proceeding.
The judgment of conviction is affirmed.
STERNBERG, C.J., and HUME, J., concur.
