BUGFIX!  The database never closed on bad requests of batches, so it was causing major problems