fixes to 5b18718ce8d5ff5a2e66fe05bed8866e32583b8c