fields is not specified, or specified without a value, looks like empty string would be returned as an invalid field.

Would prefer that empty be skipped.  So how about `elif field:` here?