many fixes so that more tests will work