Tidied code.  Added logging for some exceptions that were not logged.  Renamed the logger variable as this isn't a constant.