fixes by Matthias and Oleg