Various fixes after Vadim revision