Updated for consistency with Spark 0.9.0