[MONDRIAN-1726][MONDRIAN-1785]  Cherry pick of commits from master for SP.

SP-669
SP-596