Fixed compatibility with Spark Core