Fixed bug on close of db pool
Fixed synchronization issues on replication