anchor.diff:      lists:concat([Type, "-", binary_to_list(dec2hex(element(1, MongoId)))]).
   
   boss_to_mongo_id(BossId) ->
  -    [_, MongoId] = string:tokens(BossId, "-"),
  -    {hex2dec(MongoId)}.
  +    try
  +        [_, MongoId] = string:tokens(BossId, "-"),
  +        {hex2dec(MongoId)}
  +    catch
  +        Error:Reason -> 
  +            error_logger:warning_msg("Error parsing Boss record id: ~p:~p~n", 
  +                [Error, Reason]),
  +            []
  +    end.
  +
  +id_type_from_foreign_key(ForeignKey) ->
  +    Tokens = string:tokens(atom_to_list(ForeignKey), "_"),
  +    NameTokens = lists:filter(fun(Token) -> Token =/= "id" end, 
  +        Tokens),
  +    string:join(NameTokens, "-").
   
   attr_value(id, MongoDoc) ->
       proplists:get_value('_id', MongoDoc);
  
positive.code: find(Conn, Type, Conditions, Max, Skip, Sort, SortOrder) when is_atom(Type), is_list(Conditions), 
                                                                is_integer(Max), is_integer(Skip), 
                                                                is_atom(Sort), is_atom(SortOrder) ->
      case model_is_loaded(Type) of
          true ->
              Collection = type_to_collection(Type),
  
negative.code:         true -> calendar:now_to_datetime(Value);
          false -> Value
      end;
  mongo_to_boss_value(AttrName, Value, _RecordType) ->
      case is_id_attr(AttrName) and (Value =/= "") of 
          true -> 
              IdType = id_type_from_foreign_key(AttrName),
              mongo_to_boss_id(IdType, Value);
          false -> 
              Value
      end.
  
  attribute_names(Type) ->
      DummyRecord = apply(Type, new, lists:seq(1, proplists:get_value(new, Type:module_info(exports)))),
  