diff --git a/src/p2pool.cpp b/src/p2pool.cpp
index a65cdcb..2af3fbe 100644
--- a/src/p2pool.cpp
+++ b/src/p2pool.cpp
@@ -1596,12 +1596,10 @@ bool p2pool::zmq_running() const
 
 Params::Host p2pool::switch_host()
 {
-	const Params::Host new_host = m_params->m_hosts[++m_currentHostIndex % m_params->m_hosts.size()];
-	{
-		WriteLock lock(m_currentHostLock);
-		m_currentHost = new_host;
-	}
-	return new_host;
+	WriteLock lock(m_currentHostLock);
+
+	m_currentHost = m_params->m_hosts[++m_currentHostIndex % m_params->m_hosts.size()];
+	return m_currentHost;
 }
 
 void p2pool::reconnect_to_host()
@@ -1620,11 +1618,9 @@ void p2pool::reconnect_to_host()
 
 	WriteLock lock(m_ZMQReaderLock);
 
-	ZMQReader* old_reader = m_ZMQReader;
+	delete m_ZMQReader;
 	m_ZMQReader = nullptr;
 
-	delete old_reader;
-
 	try {
 		ZMQReader* new_reader = new ZMQReader(new_host.m_address, new_host.m_zmqPort, m_params->m_socks5Proxy, this);
 		m_zmqLastActive = seconds_since_epoch();
diff --git a/src/side_chain.cpp b/src/side_chain.cpp
index 52f3ee3..8d31e6f 100644
--- a/src/side_chain.cpp
+++ b/src/side_chain.cpp
@@ -2068,7 +2068,7 @@ void SideChain::prune_old_blocks()
 			m_pool->reconnect_to_host();
 		}
 
-		if (m_pool && m_precalcFinished.load() && (cur_time >= m_firstPruneTime + 120)) {
+		if (cur_time >= m_firstPruneTime + 120) {
 			LOGINFO(0, log::LightGreen() << "[DEV] Synchronization finished successfully, stopping P2Pool now");
 			print_status(false);
 			P2PServer* server = m_pool->p2p_server();