Fix most warnings in kv.