Merge branch 'master' of github.com:SermoDigital/jose
diff --git a/header.go b/header.go
index b5fc9e8..4bf64c5 100644
--- a/header.go
+++ b/header.go
@@ -67,7 +67,7 @@
 	if err = json.Unmarshal(b, &tmp); err != nil {
 		return err
 	}
-	*h = Header(tmp)
+	*h = tmp
 	return nil
 }
 
@@ -121,7 +121,9 @@
 // UnmarshalJSON implements json.Unmarshaler for Protected.
 func (p *Protected) UnmarshalJSON(b []byte) error {
 	var h Header
-	h.UnmarshalJSON(b)
+	if err := h.UnmarshalJSON(b); err != nil {
+		return err
+	}
 	*p = Protected(h)
 	return nil
 }