Fixed merge conflicts related to the addition of batch mode sampling and passing the sample size as a parameter to save_states_leveldb