Spark fixes