more logging fixes, exception handling improved