Merge early part of 'sp/reflog' branch