bug fixes to make Spark work well on HDInsight