Merge branch 'mh/tidy-ref-update-flags'