more global ref fixes