(1) Simplified Exception handling
(2) A correction for Interactive mode
(3) Other minor corrections