Sort libraries case-insensitive and adjust library names