incorporate some fixes to koreader-base