Several fixes and changes.