Change db insertions to batch_add from batch_add_aync, issue 516