diff --git a/ethereum.go b/ethereum.go
index 90682b396d789448e41cb13d037abf272ccf2933..b4a8cdb4add256b38d31402e5a62b626b9cc9774 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -295,7 +295,7 @@ func (s *Ethereum) Stop() {
 	s.TxPool.Stop()
 	s.BlockManager.Stop()
 
-	s.shutdownChan <- true
+	close(s.shutdownChan)
 }
 
 // This function will wait for a shutdown and resumes main thread execution
diff --git a/ethutil/config.go b/ethutil/config.go
index 5bf56134d1271cebbd151071237953b510db4079..5fdc8e1c562aca3bacd12e024ccc398b8fcf0bb6 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -46,7 +46,7 @@ func ReadConfig(base string) *config {
 			}
 		}
 
-		Config = &config{ExecPath: path, Debug: true, Ver: "0.3.0"}
+		Config = &config{ExecPath: path, Debug: true, Ver: "0.3.1"}
 		Config.Log = NewLogger(LogFile|LogStd, LogLevelDebug)
 	}
 
diff --git a/peer.go b/peer.go
index a8708206f3fa1d6ba7a997aa4f7ec6b8282a2cb6..97061971468fd2f05b790c945f949e60d3c332ea 100644
--- a/peer.go
+++ b/peer.go
@@ -511,9 +511,8 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
 		p.port = uint16(c.Get(4).Uint())
 
 		// Self connect detection
-		data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
-		pubkey := ethutil.NewValueFromBytes(data).Get(2).Bytes()
-		if bytes.Compare(pubkey, p.pubkey) == 0 {
+		key := ethutil.Config.Db.GetKeys()[0]
+		if bytes.Compare(key.PublicKey, p.pubkey) == 0 {
 			p.Stop()
 
 			return