Add support for both bytes and str.