next round of bugfixes [stefan_test]