Merge "Remove unnecessary scale check in set_ref."