numerous fixes