merged upstream changes to cube