Implements proper ordering in class list generator.
Fixes bug with order_by() implementation.