fix #791

This PR relies on koreader/koreader-base#222.