David Barth <David.Barth@epfl.ch>
further bugfixes and changes by jaromil
