If data was coming in as unicode strings (as is the case in the json parser), it failed to treat the data as equivalent to string. Correct by checking both str and unicode for now