Several fixes (in progress...)