SPARK-2988 Repl port and few other fixes.