Fix indinces in single batch writing