BATCHEE-47 patch from Michael Edgar, wrong logic in TransactionalWriter