Experimental sorting by name.

Still using deprecated getTypeId() method, will remove soon.