Don't invoke bytestring twice
Fix deprecation warnings