a lot of small changes

added synchronized methods to avoid problems
Merge branch 'Christoph'