DRILL-1671, DRILL-1653, DRILL-1652: Fixes for flatten bugs
Add handling when a null exception is logged.
Remove extraneous System.out.print statements.