work in tests, various fixes