[SPARK-2517] Remove some compiler warnings.