Fixes for better behavior during connection of replsets and avoiding duplicate connections happening