Made code working in Spark 0.8.0
Made code working in Spark 0.8.0