Backporting changes from Havana to Grizzly.