Avoid calling exit() at module level