Some style fixes. Added algorithm::clone