anchor.diff:      {ok, IP}.
   
   hopefull_data_encoding(Config) when is_list(Config) ->
  -    test_hopefull_data_encoding(Config, true),
  -    test_hopefull_data_encoding(Config, false).
  -
  -test_hopefull_data_encoding(Config, Fallback) when is_list(Config) ->
  +    MkHopefullData = fun(Ref,Pid) -> mk_hopefull_data(Ref,Pid) end,
  +    test_hopefull_data_encoding(Config, true, MkHopefullData),
  +    test_hopefull_data_encoding(Config, false, MkHopefullData),
  +
  +    %% Test funs with hopefully encoded term in environment
  +    MkBitstringInFunEnv = fun(_,_) -> [mk_fun_with_env(<<5:7>>)] end,
  +    test_hopefull_data_encoding(Config, true, MkBitstringInFunEnv),
  +    test_hopefull_data_encoding(Config, false, MkBitstringInFunEnv),
  +    MkExpFunInFunEnv = fun(_,_) -> [mk_fun_with_env(fun a:a/0)] end,
  +    test_hopefull_data_encoding(Config, true, MkExpFunInFunEnv),
  +    test_hopefull_data_encoding(Config, false, MkExpFunInFunEnv),
  +    ok.
  +
  +mk_fun_with_env(Term) ->
  +    fun() -> Term end.
  +
  +test_hopefull_data_encoding(Config, Fallback, MkDataFun) when is_list(Config) ->
       {ok, ProxyNode} = start_node(hopefull_data_normal),
       {ok, BouncerNode} = start_node(hopefull_data_bouncer, "-hidden"),
       case Fallback of
  
positive.code:     M = ModName,
      F = FuncName,
      ok;
  chk_hopefull_fallback(Other, SameOther) ->
      Other = SameOther,
      ok.
  
  %% ERL-1254
  hopefull_export_fun_bug(Config) when is_list(Config) ->
  
negative.code: 	error : undef ->
  	    ct:fail({"os_mon not built"})
      end.
  