Update

A lot of fixes and adaptations.