Fixed an error that could happen when adding some books to bookshelves.