Avoid error when prop.chisq = TRUE.
Thanks for Cassy Dorff for reporting the bug.