Fix crash when library is empty