fixes was backported from Lynx