Don't call order_by on empty queries.
Abstract the order_by safe call into the S class.