Numerous fixes and changes.