applying fixes to pykafka also
