Recoded exception handling per each main loop, initialization and MAX login segments.