changes applied from github.com/crowdmob/kafka to protect against corrupt messages