Fix CASSANDRA-6075

patch by Aleksey Yeschenko and Benjamin Lerer