Small cleanup after #19, move catching of exception to process_cmd.