Fixed query in rmg_filter_auto.