diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go
index 7df02e83f3e378990fe705124fda72a2e8b53f4d..1f11827ddc26894bdedbc9a0aac4c79669f1aeb3 100644
--- a/accounts/abi/bind/base.go
+++ b/accounts/abi/bind/base.go
@@ -170,7 +170,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
 	if value == nil {
 		value = new(big.Int)
 	}
-	nonce := uint64(0)
+	var nonce uint64
 	if opts.Nonce == nil {
 		nonce, err = c.transactor.PendingNonceAt(ensureContext(opts.Context), opts.From)
 		if err != nil {
diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go
index 51ca6c2561d3b92a2e9d8452140d1634aebd050c..f276059e284bf9bff30cc3588d2c3e846a712d4a 100644
--- a/accounts/accounts_test.go
+++ b/accounts/accounts_test.go
@@ -115,6 +115,9 @@ func TestTimedUnlock(t *testing.T) {
 
 	pass := "foo"
 	a1, err := am.NewAccount(pass)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	// Signing without passphrase fails because account is locked
 	_, err = am.Sign(a1.Address, testSigData)
@@ -147,6 +150,9 @@ func TestOverrideUnlock(t *testing.T) {
 
 	pass := "foo"
 	a1, err := am.NewAccount(pass)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	// Unlock indefinitely.
 	if err = am.TimedUnlock(a1, pass, 5*time.Minute); err != nil {
diff --git a/accounts/presale.go b/accounts/presale.go
index bb82821b9d977dbb9c7ff0b612798a6768c85cd4..f00b4f50207588d6b969827d3a7432916932d97c 100644
--- a/accounts/presale.go
+++ b/accounts/presale.go
@@ -22,6 +22,7 @@ import (
 	"crypto/sha256"
 	"encoding/hex"
 	"encoding/json"
+	"errors"
 	"fmt"
 
 	"github.com/ethereum/go-ethereum/crypto"
@@ -53,6 +54,9 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
 		return nil, err
 	}
 	encSeedBytes, err := hex.DecodeString(preSaleKeyStruct.EncSeed)
+	if err != nil {
+		return nil, errors.New("invalid hex in encSeed")
+	}
 	iv := encSeedBytes[:16]
 	cipherText := encSeedBytes[16:]
 	/*
diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go
index 03a124494569737d36e0c2a2bedda3d52d668aa0..c63542f13a2ad06ac1f6cd7808cf5783c35ab0b3 100644
--- a/cmd/geth/monitorcmd.go
+++ b/cmd/geth/monitorcmd.go
@@ -236,8 +236,9 @@ func expandMetrics(metrics map[string]interface{}, path string) []string {
 
 // fetchMetric iterates over the metrics map and retrieves a specific one.
 func fetchMetric(metrics map[string]interface{}, metric string) float64 {
-	parts, found := strings.Split(metric, "/"), true
+	parts := strings.Split(metric, "/")
 	for _, part := range parts[:len(parts)-1] {
+		var found bool
 		metrics, found = metrics[part].(map[string]interface{})
 		if !found {
 			return 0
diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go
index 11c92d451c0bd6c001012c73642389b52e15f84f..8e5944a502fd35a91df3969acf0d592e83765537 100644
--- a/cmd/utils/customflags.go
+++ b/cmd/utils/customflags.go
@@ -54,15 +54,10 @@ type DirectoryFlag struct {
 }
 
 func (self DirectoryFlag) String() string {
-	var fmtString string
-	fmtString = "%s %v\t%v"
-
+	fmtString := "%s %v\t%v"
 	if len(self.Value.Value) > 0 {
 		fmtString = "%s \"%v\"\t%v"
-	} else {
-		fmtString = "%s %v\t%v"
 	}
-
 	return withEnvHint(self.EnvVar, fmt.Sprintf(fmtString, prefixedNames(self.Name), self.Value.Value, self.Usage))
 }
 
diff --git a/console/console.go b/console/console.go
index 8865f5e899b1e1a26c1d25fc1a32eac585a6066b..9bb3df9265e404bfc02acfc4abebf02adb289c99 100644
--- a/console/console.go
+++ b/console/console.go
@@ -226,8 +226,8 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
 	}
 	// Chunck data to relevant part for autocompletion
 	// E.g. in case of nested lines eth.getBalance(eth.coinb<tab><tab>
-	start := 0
-	for start = pos - 1; start > 0; start-- {
+	start := pos - 1
+	for ; start > 0; start-- {
 		// Skip all methods and namespaces (i.e. including te dot)
 		if line[start] == '.' || (line[start] >= 'a' && line[start] <= 'z') || (line[start] >= 'A' && line[start] <= 'Z') {
 			continue
diff --git a/contracts/chequebook/cheque_test.go b/contracts/chequebook/cheque_test.go
index e35a21cc5053d558e2864cc845a711875bd137ab..85d923109274b7c5461f76fcbfcc18767728ec46 100644
--- a/contracts/chequebook/cheque_test.go
+++ b/contracts/chequebook/cheque_test.go
@@ -73,8 +73,8 @@ func TestIssueAndReceive(t *testing.T) {
 	}
 	chbook.sent[addr1] = new(big.Int).SetUint64(42)
 	amount := common.Big1
-	ch, err := chbook.Issue(addr1, amount)
-	if err == nil {
+
+	if _, err = chbook.Issue(addr1, amount); err == nil {
 		t.Fatalf("expected insufficient funds error, got none")
 	}
 
@@ -83,7 +83,7 @@ func TestIssueAndReceive(t *testing.T) {
 		t.Fatalf("expected: %v, got %v", "0", chbook.Balance())
 	}
 
-	ch, err = chbook.Issue(addr1, amount)
+	ch, err := chbook.Issue(addr1, amount)
 	if err != nil {
 		t.Fatalf("expected no error, got %v", err)
 	}
@@ -128,8 +128,8 @@ func TestCheckbookFile(t *testing.T) {
 		t.Errorf("expected: %v, got %v", "0", chbook.Balance())
 	}
 
-	ch, err := chbook.Issue(addr1, common.Big1)
-	if err != nil {
+	var ch *Cheque
+	if ch, err = chbook.Issue(addr1, common.Big1); err != nil {
 		t.Fatalf("expected no error, got %v", err)
 	}
 	if ch.Amount.Cmp(new(big.Int).SetUint64(43)) != 0 {
@@ -155,7 +155,7 @@ func TestVerifyErrors(t *testing.T) {
 	}
 
 	path1 := filepath.Join(os.TempDir(), "chequebook-test-1.json")
-	contr1, err := deploy(key1, common.Big2, backend)
+	contr1, _ := deploy(key1, common.Big2, backend)
 	chbook1, err := NewChequebook(path1, contr1, key1, backend)
 	if err != nil {
 		t.Errorf("expected no error, got %v", err)
@@ -223,7 +223,8 @@ func TestVerifyErrors(t *testing.T) {
 func TestDeposit(t *testing.T) {
 	path0 := filepath.Join(os.TempDir(), "chequebook-test-0.json")
 	backend := newTestBackend()
-	contr0, err := deploy(key0, new(big.Int), backend)
+	contr0, _ := deploy(key0, new(big.Int), backend)
+
 	chbook, err := NewChequebook(path0, contr0, key0, backend)
 	if err != nil {
 		t.Errorf("expected no error, got %v", err)
@@ -361,7 +362,8 @@ func TestDeposit(t *testing.T) {
 func TestCash(t *testing.T) {
 	path := filepath.Join(os.TempDir(), "chequebook-test.json")
 	backend := newTestBackend()
-	contr0, err := deploy(key0, common.Big2, backend)
+	contr0, _ := deploy(key0, common.Big2, backend)
+
 	chbook, err := NewChequebook(path, contr0, key0, backend)
 	if err != nil {
 		t.Errorf("expected no error, got %v", err)
@@ -380,11 +382,12 @@ func TestCash(t *testing.T) {
 	}
 
 	// cashing latest cheque
-	_, err = chbox.Receive(ch)
-	if err != nil {
+	if _, err = chbox.Receive(ch); err != nil {
 		t.Fatalf("expected no error, got %v", err)
 	}
-	_, err = ch.Cash(chbook.session)
+	if _, err = ch.Cash(chbook.session); err != nil {
+		t.Fatal("Cash failed:", err)
+	}
 	backend.Commit()
 
 	chbook.balance = new(big.Int).Set(common.Big3)
diff --git a/contracts/ens/ens_test.go b/contracts/ens/ens_test.go
index 7609668733fe2646f52a36af828c1aebf13c1af0..373ce2e30f4cabffb5f94ecd487b650682b2bbe2 100644
--- a/contracts/ens/ens_test.go
+++ b/contracts/ens/ens_test.go
@@ -29,7 +29,7 @@ import (
 var (
 	key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
 	name   = "my name on ENS"
-	hash   = crypto.Sha3Hash([]byte("my content"))
+	hash   = crypto.Keccak256Hash([]byte("my content"))
 	addr   = crypto.PubkeyToAddress(key.PublicKey)
 )
 
diff --git a/core/blockchain.go b/core/blockchain.go
index c3530b93c343a1905f7d2d3a83dc52571c471c65..8eb7de98246593e6e766348d088c52020427fa77 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -1054,11 +1054,10 @@ func (st *insertStats) report(chain []*types.Block, index int) {
 		start, end := chain[st.lastIndex], chain[index]
 		txcount := countTransactions(chain[st.lastIndex : index+1])
 
-		extra := ""
+		var hashes, extra string
 		if st.queued > 0 || st.ignored > 0 {
 			extra = fmt.Sprintf(" (%d queued %d ignored)", st.queued, st.ignored)
 		}
-		hashes := ""
 		if st.processed > 1 {
 			hashes = fmt.Sprintf("%x… / %x…", start.Hash().Bytes()[:4], end.Hash().Bytes()[:4])
 		} else {
diff --git a/core/state/managed_state_test.go b/core/state/managed_state_test.go
index d9c232ebb96c3be488a9e04eed045170e94f4b07..0a3be9f5a93d7ca65ad3411ae2dec36e5d02f29d 100644
--- a/core/state/managed_state_test.go
+++ b/core/state/managed_state_test.go
@@ -88,12 +88,12 @@ func TestRemoteNonceChange(t *testing.T) {
 		nn[i] = true
 	}
 	account.nonces = append(account.nonces, nn...)
-	nonce := ms.NewNonce(addr)
+	ms.NewNonce(addr)
 
 	ms.StateDB.stateObjects[addr].data.Nonce = 200
-	nonce = ms.NewNonce(addr)
+	nonce := ms.NewNonce(addr)
 	if nonce != 200 {
-		t.Error("expected nonce after remote update to be", 201, "got", nonce)
+		t.Error("expected nonce after remote update to be", 200, "got", nonce)
 	}
 	ms.NewNonce(addr)
 	ms.NewNonce(addr)
@@ -101,7 +101,7 @@ func TestRemoteNonceChange(t *testing.T) {
 	ms.StateDB.stateObjects[addr].data.Nonce = 200
 	nonce = ms.NewNonce(addr)
 	if nonce != 204 {
-		t.Error("expected nonce after remote update to be", 201, "got", nonce)
+		t.Error("expected nonce after remote update to be", 204, "got", nonce)
 	}
 }
 
diff --git a/crypto/secp256k1/secp256_test.go b/crypto/secp256k1/secp256_test.go
index fc6fc9b32e2a625f5a9c37a8333e848d4018f16c..e91166cf1ec9c321a155e194b03e74d96ce460f0 100644
--- a/crypto/secp256k1/secp256_test.go
+++ b/crypto/secp256k1/secp256_test.go
@@ -129,17 +129,12 @@ func signAndRecoverWithRandomMessages(t *testing.T, keys func() ([]byte, []byte)
 }
 
 func TestRecoveryOfRandomSignature(t *testing.T) {
-	pubkey1, seckey := GenerateKeyPair()
+	pubkey1, _ := GenerateKeyPair()
 	msg := randentropy.GetEntropyCSPRNG(32)
-	sig, err := Sign(msg, seckey)
-	if err != nil {
-		t.Errorf("signature error: %s", err)
-	}
 
 	for i := 0; i < TestCount; i++ {
-		sig = randSig()
-		pubkey2, _ := RecoverPubkey(msg, sig)
 		// recovery can sometimes work, but if so should always give wrong pubkey
+		pubkey2, _ := RecoverPubkey(msg, randSig())
 		if bytes.Equal(pubkey1, pubkey2) {
 			t.Fatalf("iteration: %d: pubkey mismatch: do NOT want %x: ", i, pubkey2)
 		}
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go
index b43edf53eebe83588c082e6af12a29dc45002c20..b156c471df9349242e95bdf817ca4eb8f3dea001 100644
--- a/eth/downloader/downloader_test.go
+++ b/eth/downloader/downloader_test.go
@@ -650,7 +650,7 @@ func assertOwnForkedChain(t *testing.T, tester *downloadTester, common int, leng
 	}
 	// Verify the state trie too for fast syncs
 	if tester.downloader.mode == FastSync {
-		index := 0
+		var index int
 		if pivot := int(tester.downloader.queue.fastSyncPivot); pivot < common {
 			index = pivot
 		} else {
diff --git a/les/odr_requests.go b/les/odr_requests.go
index a4fbd79f654763a3c6e64b3559a8aefa1b86a3c4..2987eb297ac0d6aaea1eda78d18bc6e0a592e951 100644
--- a/les/odr_requests.go
+++ b/les/odr_requests.go
@@ -267,8 +267,7 @@ func (self *CodeRequest) Valid(db ethdb.Database, msg *Msg) bool {
 		return false
 	}
 	data := reply[0]
-	hash := crypto.Sha3Hash(data)
-	if !bytes.Equal(self.Hash[:], hash[:]) {
+	if hash := crypto.Keccak256Hash(data); self.Hash != hash {
 		glog.V(logger.Debug).Infof("ODR: requested hash %08x does not match received data hash %08x", self.Hash[:4], hash[:4])
 		return false
 	}
diff --git a/metrics/disk_linux.go b/metrics/disk_linux.go
index d0eac08b915b1a59c0438a124281393651c8e562..8d610cd6749002f5ab596b478c64cbfc5af61b9e 100644
--- a/metrics/disk_linux.go
+++ b/metrics/disk_linux.go
@@ -47,15 +47,16 @@ func ReadDiskStats(stats *DiskStats) error {
 			}
 			return err
 		}
-		key, value := "", int64(0)
-		if parts := strings.Split(line, ":"); len(parts) != 2 {
+		parts := strings.Split(line, ":")
+		if len(parts) != 2 {
 			continue
-		} else {
-			key = strings.TrimSpace(parts[0])
-			if value, err = strconv.ParseInt(strings.TrimSpace(parts[1]), 10, 64); err != nil {
-				return err
-			}
 		}
+		key := strings.TrimSpace(parts[0])
+		value, err := strconv.ParseInt(strings.TrimSpace(parts[1]), 10, 64)
+		if err != nil {
+			return err
+		}
+
 		// Update the counter based on the key
 		switch key {
 		case "syscr":
diff --git a/node/config_test.go b/node/config_test.go
index d18732fdb08a117219451b2ffd5bf8ef73db3042..c0eda72c23b2a5d8a5d7a755b98725d91fd9fe7d 100644
--- a/node/config_test.go
+++ b/node/config_test.go
@@ -121,8 +121,7 @@ func TestNodeKeyPersistency(t *testing.T) {
 	if _, err := os.Stat(keyfile); err != nil {
 		t.Fatalf("node key not persisted to data directory: %v", err)
 	}
-	key, err = crypto.LoadECDSA(keyfile)
-	if err != nil {
+	if _, err = crypto.LoadECDSA(keyfile); err != nil {
 		t.Fatalf("failed to load freshly persisted node key: %v", err)
 	}
 	blob1, err := ioutil.ReadFile(keyfile)
diff --git a/p2p/rlpx.go b/p2p/rlpx.go
index 2a9bdc121f2fc2d1c876d6ae0f7eb5dec16a428d..c6fd841f7ccee4098e9a37eb32fa28458ec4b3ca 100644
--- a/p2p/rlpx.go
+++ b/p2p/rlpx.go
@@ -429,7 +429,7 @@ func (msg *authMsgV4) decodePlain(input []byte) {
 	n := copy(msg.Signature[:], input)
 	n += shaLen // skip sha3(initiator-ephemeral-pubk)
 	n += copy(msg.InitiatorPubkey[:], input[n:])
-	n += copy(msg.Nonce[:], input[n:])
+	copy(msg.Nonce[:], input[n:])
 	msg.Version = 4
 	msg.gotPlain = true
 }
@@ -437,13 +437,13 @@ func (msg *authMsgV4) decodePlain(input []byte) {
 func (msg *authRespV4) sealPlain(hs *encHandshake) ([]byte, error) {
 	buf := make([]byte, authRespLen)
 	n := copy(buf, msg.RandomPubkey[:])
-	n += copy(buf[n:], msg.Nonce[:])
+	copy(buf[n:], msg.Nonce[:])
 	return ecies.Encrypt(rand.Reader, hs.remotePub, buf, nil, nil)
 }
 
 func (msg *authRespV4) decodePlain(input []byte) {
 	n := copy(msg.RandomPubkey[:], input)
-	n += copy(msg.Nonce[:], input[n:])
+	copy(msg.Nonce[:], input[n:])
 	msg.Version = 4
 }
 
diff --git a/rpc/subscription_test.go b/rpc/subscription_test.go
index 97f2c0d65bfacb8f4c2f15f3e519374ec5b4cd3f..00c4e0e3545dffc7fd15a796dfca270bd368d34d 100644
--- a/rpc/subscription_test.go
+++ b/rpc/subscription_test.go
@@ -141,7 +141,7 @@ func TestNotifications(t *testing.T) {
 	}
 
 	var ok bool
-	if subid, ok = response.Result.(string); !ok {
+	if _, ok = response.Result.(string); !ok {
 		t.Fatalf("expected subscription id, got %T", response.Result)
 	}
 
diff --git a/swarm/api/api.go b/swarm/api/api.go
index 673cff350a9f2c5a180c9c25b1a53f165873231e..3f48437a5c9bfd21a8ad4e4528bf65609073e917 100644
--- a/swarm/api/api.go
+++ b/swarm/api/api.go
@@ -140,8 +140,11 @@ func (self *Api) Put(content, contentType string) (string, error) {
 // to resolve path to content using dpa retrieve
 // it returns a section reader, mimeType, status and an error
 func (self *Api) Get(uri string, nameresolver bool) (reader storage.LazySectionReader, mimeType string, status int, err error) {
-
 	key, _, path, err := self.parseAndResolve(uri, nameresolver)
+	if err != nil {
+		return nil, "", 500, fmt.Errorf("can't resolve: %v", err)
+	}
+
 	quitC := make(chan bool)
 	trie, err := loadManifest(self.dpa, key, quitC)
 	if err != nil {
@@ -166,6 +169,10 @@ func (self *Api) Get(uri string, nameresolver bool) (reader storage.LazySectionR
 
 func (self *Api) Modify(uri, contentHash, contentType string, nameresolver bool) (newRootHash string, err error) {
 	root, _, path, err := self.parseAndResolve(uri, nameresolver)
+	if err != nil {
+		return "", fmt.Errorf("can't resolve: %v", err)
+	}
+
 	quitC := make(chan bool)
 	trie, err := loadManifest(self.dpa, root, quitC)
 	if err != nil {
diff --git a/swarm/api/config.go b/swarm/api/config.go
index 14a559c75da5aaf44c9723d06c2a40187242d018..b4c6e3d4a3cde25c35eb00a5299f813409b2ad82 100644
--- a/swarm/api/config.go
+++ b/swarm/api/config.go
@@ -69,7 +69,7 @@ func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey, n
 	var data []byte
 	pubkey := crypto.FromECDSAPub(&prvKey.PublicKey)
 	pubkeyhex := common.ToHex(pubkey)
-	keyhex := crypto.Sha3Hash(pubkey).Hex()
+	keyhex := crypto.Keccak256Hash(pubkey).Hex()
 
 	self = &Config{
 		SyncParams:    network.NewSyncParams(dirpath),
diff --git a/swarm/api/filesystem.go b/swarm/api/filesystem.go
index 428f3e3acce7602f57de1e959a2584665f4992fa..96aaf36df729c4212cabac6f0fbdb59a3bcb1eb8 100644
--- a/swarm/api/filesystem.go
+++ b/swarm/api/filesystem.go
@@ -241,24 +241,7 @@ func (self *FileSystem) Download(bzzpath, localpath string) error {
 		}
 		go func(i int, entry *downloadListEntry) {
 			defer wg.Done()
-			f, err := os.Create(entry.path) // TODO: path separators
-			if err == nil {
-
-				reader := self.api.dpa.Retrieve(entry.key)
-				writer := bufio.NewWriter(f)
-				size, err := reader.Size(quitC)
-				if err == nil {
-					_, err = io.CopyN(writer, reader, size) // TODO: handle errors
-					err2 := writer.Flush()
-					if err == nil {
-						err = err2
-					}
-					err2 = f.Close()
-					if err == nil {
-						err = err2
-					}
-				}
-			}
+			err := retrieveToFile(quitC, self.api.dpa, entry.key, entry.path)
 			if err != nil {
 				select {
 				case errC <- err:
@@ -279,5 +262,24 @@ func (self *FileSystem) Download(bzzpath, localpath string) error {
 	case <-quitC:
 		return fmt.Errorf("aborted")
 	}
+}
 
+func retrieveToFile(quitC chan bool, dpa *storage.DPA, key storage.Key, path string) error {
+	f, err := os.Create(path) // TODO: path separators
+	if err != nil {
+		return err
+	}
+	reader := dpa.Retrieve(key)
+	writer := bufio.NewWriter(f)
+	size, err := reader.Size(quitC)
+	if err != nil {
+		return err
+	}
+	if _, err = io.CopyN(writer, reader, size); err != nil {
+		return err
+	}
+	if err := writer.Flush(); err != nil {
+		return err
+	}
+	return f.Close()
 }
diff --git a/swarm/api/filesystem_test.go b/swarm/api/filesystem_test.go
index f6657aedee172aa2dd722bed3dd73eb4c0d08fdd..4a27cb1da6a49aa27fb861dbf74bd9deaad7c851 100644
--- a/swarm/api/filesystem_test.go
+++ b/swarm/api/filesystem_test.go
@@ -130,6 +130,7 @@ func TestApiDirUploadModify(t *testing.T) {
 		content = readPath(t, "testdata", "test0", "index.css")
 		resp = testGet(t, api, bzzhash+"/index.css")
 		exp = expResponse(content, "text/css", 0)
+		checkResponse(t, resp, exp)
 
 		_, _, _, err = api.Get(bzzhash, true)
 		if err == nil {
diff --git a/swarm/network/kademlia/kademlia_test.go b/swarm/network/kademlia/kademlia_test.go
index 66edfe654407cee19454231cbe089784ee89d306..417ccecae6f0974ed04ba9766a4edb2384e3308e 100644
--- a/swarm/network/kademlia/kademlia_test.go
+++ b/swarm/network/kademlia/kademlia_test.go
@@ -58,9 +58,9 @@ func (n *testNode) LastActive() time.Time {
 }
 
 func TestOn(t *testing.T) {
-	addr, ok := gen(Address{}, quickrand).(Address)
-	other, ok := gen(Address{}, quickrand).(Address)
-	if !ok {
+	addr, ok1 := gen(Address{}, quickrand).(Address)
+	other, ok2 := gen(Address{}, quickrand).(Address)
+	if !ok1 || !ok2 {
 		t.Errorf("oops")
 	}
 	kad := New(addr, NewKadParams())
diff --git a/swarm/network/syncdb_test.go b/swarm/network/syncdb_test.go
index ed43fbd0664e99d24ac63370ef16b76fddba47da..21453a11029021dc631a8de751682491ff45942e 100644
--- a/swarm/network/syncdb_test.go
+++ b/swarm/network/syncdb_test.go
@@ -63,7 +63,7 @@ func newTestSyncDb(priority, bufferSize, batchSize int, dbdir string, t *testing
 		dbdir:  dbdir,
 		t:      t,
 	}
-	h := crypto.Sha3Hash([]byte{0})
+	h := crypto.Keccak256Hash([]byte{0})
 	key := storage.Key(h[:])
 	self.syncDb = newSyncDb(db, key, uint(priority), uint(bufferSize), uint(batchSize), self.deliver)
 	// kick off db iterator right away, if no items on db this will allow
@@ -79,7 +79,7 @@ func (self *testSyncDb) close() {
 
 func (self *testSyncDb) push(n int) {
 	for i := 0; i < n; i++ {
-		self.buffer <- storage.Key(crypto.Sha3([]byte{byte(self.c)}))
+		self.buffer <- storage.Key(crypto.Keccak256([]byte{byte(self.c)}))
 		self.sent = append(self.sent, self.c)
 		self.c++
 	}
@@ -126,7 +126,7 @@ func (self *testSyncDb) expect(n int, db bool) {
 		if self.at+1 > len(self.delivered) {
 			self.t.Fatalf("expected %v, got %v", self.at+1, len(self.delivered))
 		}
-		if len(self.sent) > self.at && !bytes.Equal(crypto.Sha3([]byte{byte(self.sent[self.at])}), self.delivered[self.at]) {
+		if len(self.sent) > self.at && !bytes.Equal(crypto.Keccak256([]byte{byte(self.sent[self.at])}), self.delivered[self.at]) {
 			self.t.Fatalf("expected delivery %v/%v/%v to be hash of  %v, from db: %v = %v", i, n, self.at, self.sent[self.at], ok, db)
 			glog.V(logger.Debug).Infof("%v/%v/%v to be hash of  %v, from db: %v = %v", i, n, self.at, self.sent[self.at], ok, db)
 		}
@@ -195,7 +195,7 @@ func TestSaveSyncDb(t *testing.T) {
 	go s.dbRead(false, 0, s.deliver)
 	s.expect(amount, true)
 	for i, key := range s.delivered {
-		expKey := crypto.Sha3([]byte{byte(i)})
+		expKey := crypto.Keccak256([]byte{byte(i)})
 		if !bytes.Equal(key, expKey) {
 			t.Fatalf("delivery %v expected to be key %x, got %x", i, expKey, key)
 		}
@@ -204,7 +204,7 @@ func TestSaveSyncDb(t *testing.T) {
 	s.expect(amount, false)
 	for i := amount; i < 2*amount; i++ {
 		key := s.delivered[i]
-		expKey := crypto.Sha3([]byte{byte(i - amount)})
+		expKey := crypto.Keccak256([]byte{byte(i - amount)})
 		if !bytes.Equal(key, expKey) {
 			t.Fatalf("delivery %v expected to be key %x, got %x", i, expKey, key)
 		}
diff --git a/swarm/storage/common_test.go b/swarm/storage/common_test.go
index 889b28a70b6b0f581840186cb5ec926ce43da66b..2a83f471d30d6394e9775bc80c10c2f2cd023248 100644
--- a/swarm/storage/common_test.go
+++ b/swarm/storage/common_test.go
@@ -80,7 +80,7 @@ func testStore(m ChunkStore, l int64, branches int64, t *testing.T) {
 		Hash:     defaultHash,
 	})
 	swg := &sync.WaitGroup{}
-	key, err := chunker.Split(rand.Reader, l, chunkC, swg, nil)
+	key, _ := chunker.Split(rand.Reader, l, chunkC, swg, nil)
 	swg.Wait()
 	close(chunkC)
 	chunkC = make(chan *Chunk)
diff --git a/swarm/storage/dbstore_test.go b/swarm/storage/dbstore_test.go
index e2f36a6bc8725e7f0f554ecbdc7986a6bd6a2505..3d2b5bc36f3c5160b03c5f0ab9ec5d1ffd4749be 100644
--- a/swarm/storage/dbstore_test.go
+++ b/swarm/storage/dbstore_test.go
@@ -144,7 +144,7 @@ func TestDbStoreSyncIterator(t *testing.T) {
 		t.Fatalf("unexpected error creating NewSyncIterator")
 	}
 
-	it, err = m.NewSyncIterator(DbSyncState{
+	it, _ = m.NewSyncIterator(DbSyncState{
 		Start: Key(common.Hex2Bytes("1000000000000000000000000000000000000000000000000000000000000000")),
 		Stop:  Key(common.Hex2Bytes("4000000000000000000000000000000000000000000000000000000000000000")),
 		First: 2,
@@ -168,7 +168,7 @@ func TestDbStoreSyncIterator(t *testing.T) {
 		t.Fatalf("Expected %v chunk, got %v", keys[3], res[1])
 	}
 
-	it, err = m.NewSyncIterator(DbSyncState{
+	it, _ = m.NewSyncIterator(DbSyncState{
 		Start: Key(common.Hex2Bytes("2000000000000000000000000000000000000000000000000000000000000000")),
 		Stop:  Key(common.Hex2Bytes("4000000000000000000000000000000000000000000000000000000000000000")),
 		First: 2,
diff --git a/swarm/storage/dpa_test.go b/swarm/storage/dpa_test.go
index a682324072b8fb6350a203e4764c10dfaa574d74..a23b9efebe391384e2de66b601e3397a10e4e6b6 100644
--- a/swarm/storage/dpa_test.go
+++ b/swarm/storage/dpa_test.go
@@ -120,8 +120,7 @@ func TestDPA_capacity(t *testing.T) {
 	// check whether it is, indeed, empty
 	dpa.ChunkStore = memStore
 	resultReader = dpa.Retrieve(key)
-	n, err = resultReader.ReadAt(resultSlice, 0)
-	if err == nil {
+	if _, err = resultReader.ReadAt(resultSlice, 0); err == nil {
 		t.Errorf("Was able to read %d bytes from an empty memStore.", len(slice))
 	}
 	// check how it works with localStore
diff --git a/trie/trie_test.go b/trie/trie_test.go
index 14ac5a6669c61f4c8b46a4ecffc355a2ca55a453..60307dba8c361d69ee2426d9bd5adc82df080523 100644
--- a/trie/trie_test.go
+++ b/trie/trie_test.go
@@ -56,9 +56,11 @@ func TestEmptyTrie(t *testing.T) {
 func TestNull(t *testing.T) {
 	var trie Trie
 	key := make([]byte, 32)
-	value := common.FromHex("0x823140710bf13990e4500136726d8b55")
+	value := []byte("test")
 	trie.Update(key, value)
-	value = trie.Get(key)
+	if !bytes.Equal(trie.Get(key), value) {
+		t.Fatal("wrong value")
+	}
 }
 
 func TestMissingRoot(t *testing.T) {
diff --git a/whisper/whisperv2/envelope_test.go b/whisper/whisperv2/envelope_test.go
index c1b128c6170ff6b10a61d96a60dde9c9abe14371..490ed9f6f8a61b04358ecc291add9709857a4cf4 100644
--- a/whisper/whisperv2/envelope_test.go
+++ b/whisper/whisperv2/envelope_test.go
@@ -47,7 +47,7 @@ func TestEnvelopeOpen(t *testing.T) {
 		t.Fatalf("payload mismatch: have 0x%x, want 0x%x", opened.Payload, message.Payload)
 	}
 	if opened.Sent.Unix() != message.Sent.Unix() {
-		t.Fatalf("send time mismatch: have %d, want %d", opened.Sent, message.Sent)
+		t.Fatalf("send time mismatch: have %v, want %v", opened.Sent, message.Sent)
 	}
 	if opened.TTL/time.Second != DefaultTTL/time.Second {
 		t.Fatalf("message TTL mismatch: have %v, want %v", opened.TTL, DefaultTTL)
diff --git a/whisper/whisperv5/filter.go b/whisper/whisperv5/filter.go
index 3845d0c20dd2bb9f0f47a798626357ccc89f73c1..a386aa164684a3cb5601e86769b8e6b7b0382818 100644
--- a/whisper/whisperv5/filter.go
+++ b/whisper/whisperv5/filter.go
@@ -86,7 +86,7 @@ func (fs *Filters) NotifyWatchers(env *Envelope, p2pMessage bool) {
 			continue
 		}
 
-		match := false
+		var match bool
 		if msg != nil {
 			match = watcher.MatchMessage(msg)
 		} else {
diff --git a/whisper/whisperv5/message_test.go b/whisper/whisperv5/message_test.go
index 3eb71653df9ce5fc226a6dad158a0984ee2ac637..7c90f59c0c61fe115b54606e1c0e85b35fd756be 100644
--- a/whisper/whisperv5/message_test.go
+++ b/whisper/whisperv5/message_test.go
@@ -77,10 +77,8 @@ func singleMessageTest(t *testing.T, symmetric bool) {
 
 	text := make([]byte, 0, 512)
 	steg := make([]byte, 0, 512)
-	raw := make([]byte, 0, 1024)
 	text = append(text, params.Payload...)
 	steg = append(steg, params.Padding...)
-	raw = append(raw, params.Padding...)
 
 	msg := NewSentMessage(params)
 	env, err := msg.Wrap(params)
@@ -238,10 +236,8 @@ func singleEnvelopeOpenTest(t *testing.T, symmetric bool) {
 
 	text := make([]byte, 0, 512)
 	steg := make([]byte, 0, 512)
-	raw := make([]byte, 0, 1024)
 	text = append(text, params.Payload...)
 	steg = append(steg, params.Padding...)
-	raw = append(raw, params.Padding...)
 
 	msg := NewSentMessage(params)
 	env, err := msg.Wrap(params)
diff --git a/whisper/whisperv5/whisper_test.go b/whisper/whisperv5/whisper_test.go
index dbe0627fa547ca7e990d718012579f0e807ccbcb..b9cd9b1a0184c2bda1bce7e08deb287855e7e944 100644
--- a/whisper/whisperv5/whisper_test.go
+++ b/whisper/whisperv5/whisper_test.go
@@ -50,20 +50,17 @@ func TestWhisperBasic(t *testing.T) {
 
 	peerID := make([]byte, 64)
 	randomize(peerID)
-	peer, err := w.getPeer(peerID)
+	peer, _ := w.getPeer(peerID)
 	if peer != nil {
-		t.Fatalf("failed GetPeer.")
+		t.Fatal("found peer for random key.")
 	}
-	err = w.MarkPeerTrusted(peerID)
-	if err == nil {
+	if err := w.MarkPeerTrusted(peerID); err == nil {
 		t.Fatalf("failed MarkPeerTrusted.")
 	}
-	err = w.RequestHistoricMessages(peerID, peerID)
-	if err == nil {
+	if err := w.RequestHistoricMessages(peerID, peerID); err == nil {
 		t.Fatalf("failed RequestHistoricMessages.")
 	}
-	err = w.SendP2PMessage(peerID, nil)
-	if err == nil {
+	if err := w.SendP2PMessage(peerID, nil); err == nil {
 		t.Fatalf("failed SendP2PMessage.")
 	}
 	exist := w.HasSymKey("non-existing")
@@ -85,11 +82,10 @@ func TestWhisperBasic(t *testing.T) {
 
 	var derived []byte
 	ver := uint64(0xDEADBEEF)
-	derived, err = deriveKeyMaterial(peerID, ver)
-	if err != unknownVersionError(ver) {
+	if _, err := deriveKeyMaterial(peerID, ver); err != unknownVersionError(ver) {
 		t.Fatalf("failed deriveKeyMaterial with param = %v: %s.", peerID, err)
 	}
-	derived, err = deriveKeyMaterial(peerID, 0)
+	derived, err := deriveKeyMaterial(peerID, 0)
 	if err != nil {
 		t.Fatalf("failed second deriveKeyMaterial with param = %v: %s.", peerID, err)
 	}