fix #872

This patch relies on merge of koreader/koreader-base#223.