Bugs and fixes for EventStoreRepository