Changed function in shards.cc to take reference.