In python3, a single element reference of a bytes is an int, not equal to a b'' of the same length and value. Change to use slices to have python2 and python3 act the same.