Raise error instead of sys.exit when reference name does not exist.