fix major problems identified by go vet