Numerous fixes.