Added logging to System.exit calls