Merging changes from rgrinberg