SPY-302 backporting of SPARK-1620, SPARK-1685, SPARK-1686, SPARK-1772