Apply same changes to query subcommand