fix problems around bytes on python 3