anchor.diff:      erlcass_log:send(State#state.log_pid, ?CASS_LOG_INFO, <<"Prepared statement id: ~p result: ~p">>, [Identifier, Result]),
   
       case Result of
  -        {ok, StatementRef} ->
  -            erlcass_prep_utils:set(Identifier, State#state.session, StatementRef),
  +        {ok, StmRef} ->
  +            erlcass_prep_utils:set(Identifier, State#state.session, StmRef),
               gen_server:reply(From, ok);
           _ ->
               gen_server:reply(From, Result)
  
positive.code: 
  -define(SERVER, ?MODULE).
  
  -record(state, {session, connected, log_pid, log_fun}).
  
  -spec(set_cluster_options(OptionList :: list()) ->
      ok | badarg | {error, Reason :: binary()}).
  
  set_cluster_options(Options) ->
      gen_server:call(?MODULE, {set_cluster_options, Options}).
  
  -spec(create_session(Args :: list()) ->
      ok | badarg | {error, Reason :: binary()}).
  
  create_session(Args) ->
      gen_server:call(?MODULE, {create_session, Args}, ?CONNECT_TIMEOUT).
  
  -spec(set_log_function(Func :: term()) ->
      ok | badarg | {error, Reason :: binary()}).
  
  set_log_function(Func) ->
      gen_server:call(?MODULE, {update_log_function, Func}).
  
  -spec(get_metrics() ->
      {ok, MetricsList :: list()} | badarg | {error, Reason :: binary()}).
  
  get_metrics() ->
      gen_server:call(?MODULE, get_metrics).
  
  -spec(create_statement(Query :: binary() | {binary(), integer()}, BindParams :: list()) ->
      {ok, StatementRef :: reference()} | badarg | {error, Reason :: binary()}).
  
  create_statement(Query, BindParams) ->
      erlcass_nif:cass_statement_new(Query, BindParams).
  
  -spec(create_statement(Query :: binary() | {binary(), integer()}) ->
      {ok, StatementRef :: reference()} | badarg | {error, Reason :: binary()}).
  
  create_statement(Query) ->
      erlcass_nif:cass_statement_new(Query).
  
  -spec(add_prepare_statement(Identifier :: atom(), Query :: binary() | {binary(), integer()}) ->
      ok | already_exist | badarg | {error, Reason :: binary()}).
  
  add_prepare_statement(Identifier, Query) ->
      gen_server:call(?MODULE, {add_prepare_statement, Identifier, Query}, ?TIMEOUT).
  
  -spec(bind_prepared_statement(Identifier :: atom()) ->
      {ok, Statement :: #erlcass_stm{}} | badarg | {error, Reason :: binary()}).
  
  bind_prepared_statement(Identifier) ->
      case erlcass_prep_utils:get(Identifier) of
          undefined ->
              {error, undefined};
          {Session, PrepStatement} ->
              {ok, StatementRef} = erlcass_nif:cass_prepared_bind(PrepStatement),
              {ok, #erlcass_stm{session = Session, stm = StatementRef}}
      end.
  
  -spec(bind_prepared_params_by_name(Stm :: #erlcass_stm{} | reference() , Params :: list()) ->
      ok | badarg | {error, Reason :: binary()}).
  
  bind_prepared_params_by_name(Stm, Params) when is_record(Stm, erlcass_stm) ->
      erlcass_nif:cass_statement_bind_parameters(Stm#erlcass_stm.stm, ?BIND_BY_NAME, Params);
  
  bind_prepared_params_by_name(Stm, Params) ->
      erlcass_nif:cass_statement_bind_parameters(Stm, ?BIND_BY_NAME, Params).
  
  -spec(bind_prepared_params_by_index(Stm :: #erlcass_stm{} | reference(), Params :: list()) ->
      ok | badarg | {error, Reason :: binary()}).
  
  bind_prepared_params_by_index(Stm, Params) when is_record(Stm, erlcass_stm) ->
      erlcass_nif:cass_statement_bind_parameters(Stm#erlcass_stm.stm, ?BIND_BY_INDEX, Params);
  
  bind_prepared_params_by_index(Stm, Params) ->
      erlcass_nif:cass_statement_bind_parameters(Stm, ?BIND_BY_INDEX, Params).
  
  -spec(async_execute_statement(Stm :: reference() | #erlcass_stm{}) ->
      {ok, Tag :: reference()} | badarg | {error, Reason :: binary()}).
  
  async_execute_statement(Stm) when is_record(Stm, erlcass_stm) ->
      Tag = make_ref(),
      Result = erlcass_nif:cass_session_execute(Stm#erlcass_stm.session, Stm#erlcass_stm.stm, self(), Tag),
      {Result, Tag};
  
  async_execute_statement(Stm) ->
      gen_server:call(?MODULE, {execute_normal_statements, Stm}).
  
  -spec(execute_statement(StatementRef :: reference()) ->
      {ok, Result :: list()} | badarg | {error, Reason :: binary()}).
  
  execute_statement(StatementRef) ->
      {ok, Tag} = async_execute_statement(StatementRef),
      receive_response(Tag).
  
  -spec(async_execute(Identifier :: atom() | binary()) ->
      {ok, Tag :: reference()} | badarg | {error, Reason :: binary()}).
  
  async_execute(Identifier) ->
      case is_atom(Identifier) of
  
negative.code: 
      case erlcass_prep_utils:does_exist(Identifier) of
          true ->
              {reply, {error, already_exist}, State};
          _ ->
              ok = erlcass_nif:cass_session_prepare(State#state.session, Query, {From, Identifier}),
              {noreply, State}
      end;
  
  handle_call({execute_normal_statements, StmRef}, From, State) ->
      Tag = make_ref(),
      {FromPid, _} = From,
      Result = erlcass_nif:cass_session_execute(State#state.session, StmRef, FromPid, Tag),
      {reply, {Result, Tag}, State};
  
  handle_call({batch_execute, BatchType, StmList, Options}, From, State) ->
  