Back porting BZ-1019378
Merge pull request #1367 from clebertsuconic/2.2.x

Back porting BZ-1019378