fixes to 3d0f19a9ed9e80b3fc5d768bcbba05f94582e889