Improved tests and fixed bug in batch deletes