Add riak_test codes and a bit fix