
478 N.W.2d 764 (1991)
STATE of Minnesota, Respondent,
v.
Henry Sylvester ZIMMER, Appellant.
No. C2-91-500.
Court of Appeals of Minnesota.
December 10, 1991.
Review Granted January 27, 1992.
*765 Hubert H. Humphrey III, Atty. Gen., St. Paul, Paul A. Thompson, Columbia Heights, for respondent.
John E. Mack, New London, for appellant.
Considered and decided by NORTON, P.J., and LANSING and SHORT, JJ.

OPINION
NORTON, Judge.
This is an appeal from a judgment of conviction and sentence for misdemeanor trespass. We affirm.

FACTS
Henry Zimmer, appellant, is a baptized Roman Catholic and had been a member of Immaculate Conception Parish since 1969. In 1981, Father Sochacki was appointed pastor of the parish. Over time, appellant became dissatisfied with some of the actions and statements of Father Sochacki. Appellant confronted Father Sochacki with his disagreements on many occasions. Appellant started handing out leaflets and pamphlets at services and outside of the parish. Appellant also started carrying a two-foot crucifix with him to mass.
Father Sochacki testified at trial that he determined appellant's behavior was harmful and damaging to the parish and the rest of the parishioners. He had consulted with his bishop for advice on what should be done. His bishop did not specifically authorize Father Sochacki to bar appellant from the parish, but instead suggested to just let things go and things would work out. Father Sochacki also consulted with the parish council regarding his concerns about appellant's behavior. Father Sochacki testified that it was his decision alone, but in consultation with the parish council, to finally bar appellant from parish property.
On April 3, 1990, Father Sochacki hand delivered a letter to appellant. The letter stated in part:
[D]uring the past weeks your presence and your actions have intimidated and harassed many members of our parish both during weekend liturgies and at daily mass. You have been a constant source of fear to many of our parishioners.
With this letter I would like to take the opportunity to inform you that you are no longer allowed on our property * * *. If you chose [sic] to return to the property, you will be arrested.
While hand delivering the letter to appellant, Father Sochacki also verbally told appellant what the letter said and told him he was not welcome on parish property any more.
On April 4, 1990, the day after the letter was received by appellant, appellant entered the parish school. When appellant *766 entered the school, Father Sochacki saw him, went up to him, and told him that he had to leave. While Father Sochacki went to call the police, appellant left the school and waited in his car. The police arrived and after speaking with Father Sochacki went to appellant and tagged him for trespass.
On July 4, 1990, appellant returned to the parish to participate in mass. Father Sochacki asked appellant to leave but did not interrupt mass and went ahead with the service. However, at the conclusion of the service, Father Sochacki issued a citizen's arrest and the police later tagged appellant for trespass.
After a jury trial, appellant was convicted on two counts of trespass for the April 4th and July 4th incidents. Appellant's sentence was a $200 fine and one year probation conditioned on his obeying the letter from Father Sochacki and staying off parish property for one year.

ISSUES
I. Did the trial court erroneously limit the evidence that appellant could present at trial?
II. Did the trial court abuse its discretion by refusing to allow appellant's three witnesses to testify?
III. Was the admission of Judge Roith's testimony prejudicial error?
IV. Do the facts of the April 4 incident support a conviction for trespass?
V. Was the court's sentence an abuse of its discretion?

ANALYSIS

I.
Appellant was convicted of misdemeanor trespass under Minn.Stat. § 609.605, subd. 1(b)(3) (Supp.1989) which says:
(b) A person is guilty of a misdemeanor if the person intentionally:
* * * * * *
(3) trespasses on the premises of another and, without claim of right, refuses to depart from the premises on demand of the lawful possessor.

A. Canon law.

Appellant first argues that his claim of right relied on the Code of Canon Law and that the trial court erred by refusing to receive the code as evidence. The trial court's evidentiary rulings are reviewed under an abuse of discretion standard. State v. Flores, 418 N.W.2d 150, 158 (Minn.1988). Although the trial court did not explain its reason for refusing the code, it appears that the reason was irrelevance.
The trial court did not err by excluding canon law. Subjective reasons not related to a claimed property right are irrelevant to a claim of right. State v. Brechon, 352 N.W.2d 745, 750 (Minn.1984). Later civil cases involving church property disputes further support the court's refusal to admit the code of canon law.
In Jones v. Wolf, 443 U.S. 595, 99 S.Ct. 3020, 61 L.Ed.2d 775 (1979), the Supreme Court approved the "neutral principles of law" approach when deciding church property disputes. Id. at 603, 99 S.Ct. at 3025. This approach relies on deeds, local church charters, and state statutes, thus avoiding the constitutional pitfalls of deciding disputes on the basis of church doctrine. Id. See also Piletich v. Deretich, 328 N.W.2d 696, 701 (Minn.1982) (adopting the neutral principles of law approach). Likewise, a criminal court should avoid deciding disputes on the basis of church doctrine.

B. Court's comments.

Next, appellant argues that the court erroneously informed him before trial that it would rule as a matter of law that the priest was the lawful possessor and that appellant was without claim of right to be on church property.
The state had the burden of proving that the priest was the lawful possessor and that appellant was without claim of right. See Brechon, 352 N.W.2d at 750. However, even assuming that the court made erroneous statements of law:

*767 [A] decision will not be reversed if it is found to be harmless beyond a reasonable doubt. A ruling is prejudicial and therefore reversible if there is a reasonable possibility the error complained of may have contributed to the conviction.
State v. Kelly, 435 N.W.2d 807, 813 (Minn. 1989) (citation omitted).
When the court made its pretrial comments, the only formal motion before it was an evidentiary issue. The only ruling that the court made was to sustain respondent's objection to the receipt of the code of canon law. Appellant has not indicated why the court's comments were prejudicial. In fact, he stated his intention before trial to go ahead and present testimony on both issues. He made no showing of any other evidence that was excluded based on the judge's comments. Further, the court went on to instruct the jury on the elements of trespass including lawful possessor and claim of right.
Appellant was allowed to testify on the issue of claim of right. He testified that he had been a member of the parish for twenty years and that his children attended the parish school. He testified about the disagreements he had with Father Sochacki concerning the liturgy and other incidents. He testified that he entered parish property because he believed he had a right to as a member of the church. He testified he had never been excommunicated. Appellant has failed to show how the judge's pretrial comments affected the outcome of the trial. The judge's comments were harmless error and do not require reversal.

II.
In a pretrial order dated October 11, 1990 which set trial for November 19, 1990, the court ordered that no witnesses other than those listed or others disclosed to the court within seven days of the order would be allowed to testify. On January 3, 1991, appellant faxed to respondent a list of three additional witnesses. The trial court refused to allow appellant's additional witnesses to testify, based on the October 11, 1990 order.
The refusal to allow a defendant's material witnesses to testify as a discovery sanction can violate the sixth amendment right to compulsory process. See Taylor v. Illinois, 484 U.S. 400, 410, 108 S.Ct. 646, 653, 98 L.Ed.2d 798 (1988). A trial court must balance the integrity of the adversary process against the "potential prejudice to the truth-determining function of the trial process." Id. at 415, 108 S.Ct. at 655.
Appellant's offer of proof regarding the witnesses was that they would testify that they were longtime members of the parish, that over the years they were in attendance at the parish when appellant was, that they did not consider his behavior disturbing and that many parishioners were dissatisfied with Father Sochacki.[1]
Applying the balancing test from Taylor, the court's action was not prejudicial error. Appellant was clearly aware of the court's order pertaining to witnesses and had submitted a timely witness list. Appellant offered no explanation for his later request to add witnesses. Further, appellant's witnesses' testimony was of marginal relevance. Here the balance weighs on the side of protecting the integrity of the adversary system. The trial court did not abuse its discretion in excluding appellant's witnesses.

III.
The judge presiding at the trial may not testify in that trial as a witness. No objection need be made in order to preserve the point.
Minn.R.Evid. 605.
Appellant argues that because Judge Roith presided at a dismissal in an earlier matter, he was a presiding judge and not competent to testify. However, Judge Roith was not presiding at any time when the jury was present; therefore, rule 605 did not bar his testimony. See also *768 State v. Sandquist, 146 Minn. 322, 325-26, 178 N.W. 883, 885 (1920) (reason for rule is that judge will influence jury and deprive party of a fair trial).
Appellant also argues that the judge's testimony had no relevancy and therefore its purpose must have been to prejudice the jury against him. However, respondent had a legitimate purpose for calling the judge on rebuttal.[2] Appellant made no showing that the judge was called in bad faith.

IV.
Appellant argues that as a matter of law, he could not be guilty of trespass for the April 4 incident because he immediately left the property when asked. We agree. Although appellant failed to raise this issue at the trial level, we address it because allowing the conviction to stand would be prejudicial error. See State v. Shamp, 427 N.W.2d 228, 230 (Minn.1988) (relief from unobjected to trial error only if error is prejudicial and affects substantial rights).
Appellant was charged under section 609.605, subd. 1(b)(3) which clearly includes as an element "refuses to depart from the premises on demand of the lawful possessor." Respondent argues that to require a demand and refusal to depart as an element of the crime would lead to an absurd result. Respondent argues that the result would condone continuing trespass by individuals previously informed that they have no right to enter property. In this case, respondent argues that the letter from Father Sochacki was an advance demand to depart and that Father Sochacki did not need to further demand appellant's departure in order to show criminal trespass.
Respondent's argument is contrary to the canons of statutory construction. See Minn.Stat. § 645.16 (1990) ("Every law shall be construed * * * to give effect to all its provisions."). This is especially true in light of provision (7) of the trespass statute that could apply in the case of continuing trespass to include a person who intentionally:
returns to the property of another with the intent to harass, abuse, or threaten another, after being told to leave the property and not to return, if the actor is without claim of right to the property or consent of one with authority to consent.
Minn.Stat. § 609.605, subd. 1(b)(7) (Supp. 1989). Adopting respondent's argument would eliminate the "refusal to leave after demand" provision of (3) and make (7) unnecessary.

V.
Appellant argues that the portion of his sentence ordering him to abide by Father Sochacki's letter and stay off parish property for one year violates his fundamental right to attend his church. Appellant relies on State v. Friberg, 435 N.W.2d 509 (Minn.1989). Factors that apply to test the validity of geographic exclusions as a condition of probation are:
1) the purpose sought to be served by probation;
2) the extent to which constitutional rights enjoyed by law-abiding citizens should be accorded to probationers; and
3) the legitimate needs of law enforcement.
Id. at 516 (citation omitted).
Here, appellant is prohibited from entering only one parish. Further, protecting other parishioners and preventing repeat offenses are legitimate objectives. The court's sentence meets the Friberg test and is not an abuse of discretion. See id. at 516-17.
Although we reverse appellant's conviction for the April 4th incident, this does not require reversal of the sentence. See State v. Byman, 410 N.W.2d 921, 924 (Minn.App. *769 1987) (misdemeanor sentence will not be reversed where it was allowed by statute). Appellant's sentence was within the law and appropriate for appellant's remaining conviction. See Minn.Stat. § 609.02, subd. 3 (1988) (maximum sentence for misdemeanor is $700 fine and 90 days).

DECISION
The evidence presented at trial did not support appellant's conviction for the April 4th incident. The trial court's evidentiary rulings were not an abuse of discretion. The sentence imposed by the trial court was not an abuse of discretion.
Affirmed in part and reversed in part.
SHORT, Judge (dissenting).
I concur in the majority's decision insofar as it affirms Zimmer's conviction and sentence. I respectfully dissent as to the reversal of the April 4, 1990 trespass conviction. First, Zimmer failed to raise this issue at trial, so it is not properly before us. See State v. Kelley, 295 N.W.2d 521, 522 (Minn.1980). Second, viewing the evidence in the light most favorable to the verdict, the jury may have found that Zimmer refused to depart the premises on April 4 upon the demand of the lawful possessor. Under these circumstances, I would affirm the trial court.
NOTES
[1]  In his offer of proof, appellant indicated he only intended to call two of the witnesses he lists in his appeal. He indicated he would not call Larry Case so there is no possibility of prejudicial error regarding that witness.
[2]  Appellant testified as follows:

Q Have you ever had a hearing before the church?
A No.
Q Anybody ever given you a hearing or suggested one?
A No.
The judge was on the parish council and testified that appellant had appeared before the council.
