Change str isinstance() check to bytes.