Merged in from master.
Upgraded merged in code