Made .encode() calls conditional, in case people explicitly pass bytes in Python 3