Fixed library searching and sorting crashes