Adapted to QueryTable trunk