fixed issue #403: Usage of exit() etc.