Comparisons with CharRefs and other bugfixes related to them