retry flag added and daemon update.

This is a squash of four commits ported from hg.