Various fixes and adaptations.