Fix for TermAttributeReference bug with deterministic ids.