Modifying length to handle bytestrings too.