fix #786

Note that this also "fixes" getBare() to replace html entities with
their character equivalent.