Port of patch #16 to 2.0