Various fixes and changes.