Made a few minor tweaks to get this working for submission to standalone Spark cluster.