Backported #140 to support/1.1 branch