(library) Simplify method to check library entries
(library) Fix crash when selecting items from menu
(library) Improve performance