Use as_bytes() for indexing also in tests.