fixed logging and exception handling for xmax/gui programs