Fixed sorting issue with libraries