Fix bug on library with delete books from related tables