Fixed query errors in modes