Numerous small fixes and adjustment.