Improved query export compatibility