SOS-1314 & SOS-1394

Please backport to 6.1.20