Fix a bug in remove subcommand