Clean up some of the queries; add checks for book status when looking up books for sale.