Fixes bugs in CLI app.