Merge upstream
redo patch with scales updates