Port commit dwann/spark dc14a43a941948e867c7776d7f4b273ac80ebc2f