Merge "Fix potential crash in sync." into gingerbread