Several changes. Thanks to Stefan and Anja for testing.