Porting 1.7.x issue #1 fix to 1.8.x