Fix #58: reconnect replica on connection errors
Merge remote-tracking branch 'origin/gh-58-replica-reconnect'