Fix crashes while lending

Fix some crashes while trying to lend a book.