Add tests. Avoid invoking exit() method.