Add default ordering and fix tests