Fix a bug in the command-line tool