
79 Cal.Rptr.2d 80 (1998)
67 Cal.App.4th 532
In re KHONSAVANH S., a Person Coming Under the Juvenile Court Law.
The PEOPLE, Plaintiff and Respondent,
v.
KHONSAVANH S., Defendant and Appellant.
No. D029627.
Court of Appeal, Fourth District, Division One.
October 14, 1998.
Christopher Blake, under appointment by the Court of Appeal, San Diego, for Defendant and Appellant.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Gary W. Schons, Assistant Attorney General, Raquel M. Gonzalez, and Meagan J. Beale, Deputy Attorneys General, for Plaintiff and Respondent.
Certified for Partial Publication.[*]
HALLER, Associate Justice.
In two separate incidents, members of the Oriental Killer Boys (OKB) shot at members of a rival street gang, the Oriental Boy Soldiers (OBS). A petition filed in juvenile court under Welfare and Institutions Code section 602, charged Khonsavanh S. with six counts of attempted murder (Pen.Code,[1] §§ 664, 187) and six counts of assault with a firearm (§ 245, subd. (a)(2)). The court dismissed the two counts related to the first incident, and the petition was amended to allege assault with a firearm (§ 245, subd. (a)(2)) in the second incident. The court made true findings and committed Khonsavanh to the California Youth Authority for a maximum term of 23 years and 4 months.
Khonsavanh unpersuasively contends insufficient evidence supports the court's finding he aided and abetted others in the second incident. We agree, however, that the court *81 erred by ordering Khonsavanh to undergo testing for acquired immunodeficiency syndrome (AIDS), and that the correct maximum term of confinement is 18 years and 4 months. Accordingly, we affirm the judgment as modified.

FACTS
At about midnight on March 13, 1997, Sothan D., an OBS member, was standing outside his apartment building. A Toyota Supra and a Volkswagen Jetta slowly approached, and Sothan saw a handgun pointing from the Supra. As numerous shots were fired, Sothan fled. He was not injured, but his dog was shot in the leg.
The next evening, fellow OKB members Khonsavanh, Monthanny N., the driver of the Supra, and "Nasi," the driver of the Jetta, attended a party. Members of OBS were loitering nearby. Khonsavanh, Monthanny, Nasi and others left to "go cruising" in OBS territory; Khonsavanh rode in Nasi's car.
The same night, Sothan was at his neighbor Kathleen O.'s house. Also present were Mao V., another OBS member, Howard S. and Carrie G. Sothan glanced outside and saw the same cars involved in the previous night's shooting. A young Asian male then peered through the open front door of Kathleen's house. Someone inside said, "[i]t's on," and Sothan and others ducked. As Kathleen struggled to shut the door, three shots were fired at her. Ten to twenty more shots were fired at and into the house, many at head or chest level. No one was injured.
Investigators traced the Supra to Monthanny. He admitted to Detective Stephen Kingkade, of the San Diego Police Department's Asian Gang Unit, that he was involved in the March 13 and 14 incidents. Monthanny led Detective Kingkade to the shooting sites, and to the home of "Little Lazy," later learned to be Khonsavanh's nickname.
Detective Kingkade and another officer contacted Khonsavanh. After listening to the taped interview with Monthanny, Khonsavanh agreed to talk to the officers. He admitted he and another male he did not know were in Nasi's Jetta during the March 14 incident. Khonsavanh reported that after leaving the party, they "went out cruising, and they cruised by where the OBS hang out," and "stopped where the OBS were...." He said he was in the back seat, sleepy from drinking alcohol at the party, and "the next thing he remembers is being [awakened] by the sound of gunfire. He then saw his friend, Na [Nasi] get back into his vehicle, and they drove away."
At trial, Khonsavanh testified he believed Nasi would take him straight home from the party. Khonsavanh assertedly got drunk at the party and fell asleep in the back seat of the Jetta before it reached Kathleen's house. He denied knowing any guns were in the car or any plan to commit a crime. Khonsavanh admitted he was familiar with OBS territory because his grandmother once lived there. He also admitted he told Detective Kingkade that when he got in Nasi's car he was going to go cruising, and he and his companions "were cruising around and we stopped where the OBS were[.]" Based on the demeanor and credibility of the witnesses, the court made true findings on the aiding and abetting charges stemming from the March 14 incident.

DISCUSSION

I. Aiding and Abetting[**]

II. Aids Test

Khonsavanh contends the court erred at the disposition hearing by ordering him to undergo an AIDS test. The Attorney General claims waiver based on the failure to object below. It relies on People v. Scott (1994) 9 Cal.4th 331, 353, 36 Cal.Rptr.2d 627, 885 P.2d 1040, in which the Supreme Court held the waiver doctrine applies to claims regarding the trial court's failure to properly make or articulate its sentencing choices. "Routine defects in the court's statement of reasons are easily prevented and corrected if called to the court's attention. As in other waiver cases, we hope to reduce the number of errors committed in the first instance and preserve the judicial resources otherwise used to correct them." (Ibid.)
*82 In its analysis, the court noted in People v. Scott: "The parties have ample opportunity to influence the court's sentencing choices under the determinate scheme. As a practical matter, both sides often know before the hearing what sentence is likely to be imposed and the reasons therefor. Such information is contained in the probation report, which is required in every felony case and generally provided to the court and parties before sentencing. [Citations.] In anticipation of the hearing, the defense may file, among other things, a statement in mitigation urging specific sentencing choices and challenging the information and recommendations contained in the probation report. [Citations.] Relevant argument and evidence also may be presented at sentencing. [Citations.]" (Id. at pp. 350-351, 36 Cal.Rptr.2d 627, 885 P.2d 1040.)
The Attorney General also cites In re Abdirahman S. (1997) 58 Cal.App.4th 963, 971, 68 Cal.Rptr.2d 402, in which we explained waiver principles "are fully applicable to hearings at which conditions of juvenile probation are determined. In both adult and juvenile cases, the time to object is at the pertinent hearing, not for the first time on appeal. [Citation.] ... Objection and waiver principles `encourage prompt detection and correction of error, and ... reduce the number of unnecessary appellate claims....' [Citation.]" We noted, "the juvenile court is vested with broad discretion to select appropriate probation conditions, and thus a minor has ample opportunity to influence the court's decision." (Ibid.) Indeed, there, the minor successfully objected to one condition recommended by the probation officer. (Ibid.)
While this case does not concern sentencing choices or probation terms, we cannot overstress the importance of raising timely objections at juvenile court hearings in order to reduce the number of unnecessary appellate claims. Moreover, "`it is unfair to the trial judge and to the adverse party to take advantage of an error on appeal when it could easily have been corrected at the trial.' [Citation.]" (Doers v. Golden Gate Bridge Etc. Dist. (1979) 23 Cal.3d 180, 184-185, fn. 1, 151 Cal.Rptr. 837, 588 P.2d 1261, original italics.)
Nonetheless, under the peculiar circumstances here, we conclude waiver principles do not preclude appellate review. "Involuntary AIDS or human immunodeficiency virus (HIV) testing is strictly limited by statute. [Citations.]" (People v. Guardado (1995) 40 Cal.App.4th 757, 763, 47 Cal.Rptr.2d 81.) Nothing in the record even remotely suggests any statutory basis for AIDS testing, or that such testing was being recommended, requested or considered. To the contrary, the issue only arose fleetingly at the close of the disposition hearing, when the court stated: "Also I think ... AIDS testing was not included in the recommendation. That's also included. [¶] Anything else? [11] If there is nothing further, we're adjourned in this matter." In sum, in stark contrast to People v. Scott and In re Abdirahman S., it appears counsel here was utterly surprised by the court's ruling and had little opportunity to react. We thus reach the merits of Khonsavanh's claim.
Generally, a person may not be involuntarily tested for "evidence of antibodies to the probable causative agent of AIDS " (Health & Saf.Code, § 120990, subd. (a).) The Legislature has declared, however, that the spread of HIV (human immunodeficiency virus) and AIDS in correctional facilities, including the California Youth Authority and other juvenile facilities, presents a danger to the public peace, safety and health, and a grave danger to inmates and law enforcement personnel, particularly due to the high number of assaults and other illegal activities. (§§ 7500, subd. (a) & (b), 7502, subd (a).) To ameliorate these dangers, the Legislature has determined that inmates exhibiting clinical symptoms of HIV or AIDS may be ordered to undergo testing. (§ 7512.5.)
Further, inmates who have exposed law enforcement personnel to their bodily fluids may be ordered to undergo testing, if the chief medical officer "finds that, considering all of the facts and circumstances, there is a significant risk that HIV was transmitted." (§§ 7511, subd. (b), 7510.) Testing may also be ordered where there is a significant risk HIV was transmitted from inmate to inmate. *83 (§ 7512, subds. (a) & (c).) When the subject of a request for testing under section 7512 is in the California Youth Authority or other juvenile facility, permission must be sought from his or her parents. If denied, the facility may request an order from the juvenile court. (§ 7512, subd. .(b).)
In addition to the above, the court shall order a juvenile to undergo AIDS testing if the alleged victim of specified sexual crimes or the prosecuting attorney petitions for it, and the court finds probable cause exists to believe that a possible transfer of bodily fluid took place between the minor and the alleged victim. (Health & Saf.Code, § 121055.) If the court makes true findings to specified sexual crimes, AIDS testing of the juvenile perpetrator is required. (§ 1202.1.) A juvenile charged with assaulting a peace officer, firefighter or emergency personnel is also subject to involuntary AIDS testing upon a finding of probable cause. (Health & Saf. Code, § 121060.)
Here, there is simply no evidence any of the above provisions applies, and the Attorney General does not so contend. Accordingly, we conclude the court erred by ordering Khonsavanh to undergo AIDS testing.[4]

III. Maximum Term of Confinement[***]

DISPOSITION
The trial court's order that Khonsavanh be tested for AIDS is stricken, and the order of commitment is modified to fix a maximum term of confinement of 18 years, 4 months. In all other respects, the judgment is affirmed.
WORK, Acting P.J., and BENKE, J., concur.
NOTES
[*]  Pursuant to California Rules of Court, rules 976(b) and 976.1, this opinion is certified for publication with the exception of parts I and III.
[1]  All statutory references are to the Penal Code except where otherwise specified.
[**]  See footnote *, ante.
[4]  We recognize the issue is probably moot as to Khonsavanh. In the event this is not an isolated problem, however, we intend our holding to be instructive to the local juvenile court.
[***]  See footnote *, ante.
