Backport of WELD-1291 and WELD-1323 to 1.1 branch