SPARK-1729. Fixes based on review.