some small fixes (reorganizeMain) to bring up tests again