Several fixes after testing