Fix bug in sorting virtual columns with pagination.