Ref fd43865c: restore correct logic