SPARK-1729. Some test changes and changes to utils classes.