UnmarshalJSON should return an error for invalid types