some fixes after Simon's review