Kafka 0.8 compatibility

Modifications for kafka 0.8 compatibility