Updated for calibre v 0.9.18