Remove unused indexes
Fix many instances of DB transactions being left open